From 02208acbb58ed36bc5551bef4cf1ff41a1fd9d0b Mon Sep 17 00:00:00 2001 From: Artem Boldariev Date: Thu, 14 Apr 2022 18:39:20 +0300 Subject: [PATCH] Dig: do not hang on TLS context creation errors There was a query_detach() call missing in dig, which could lead to dig hanging on TLS context creation errors. This commit fixes. The error was introduced because the Strict TLS implementation was initially made over an older version of the code, where this extra query_detach() call was not needed. --- bin/dig/dighost.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 8eb5895f10..9024912fde 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -3034,6 +3034,9 @@ failure_tls: } else { next = NULL; } + if (connectquery != NULL) { + query_detach(&connectquery); + } query_detach(&query); if (next == NULL) { clear_current_lookup();