]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
make sure current_query is detached before trying next server
authorJINMEI Tatuya <jtatuya@infoblox.com>
Thu, 30 Oct 2025 00:51:59 +0000 (17:51 -0700)
committerArаm Sаrgsyаn <aram@isc.org>
Mon, 3 Nov 2025 19:37:09 +0000 (19:37 +0000)
Without this, start_udp or start_tcp would trigger an assertion
failure. Detaching it at this point is also consistent with
other failure handling cases, such as in recv_done.

bin/dig/dighost.c

index 5928c265bd8a8c3f270269df663f61c3f85574f7..c3516456360521fdcb4fbf123dd07eb8339de3b7 100644 (file)
@@ -3331,6 +3331,14 @@ try_next_server(dig_lookup_t *lookup) {
                return false;
        }
 
+       /*
+        * We reach here only when either start_udp or start_tcp fails in
+        * get_address(), at which point lookup's current_query must be attached
+        * to the query that just failed. We need to detach it before trying
+        * the next server similar to, e.g., recv_done().
+        */
+       query_detach(&lookup->current_query);
+
        debug("trying next server...");
 
        if (lookup->tcp_mode) {