]> 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>
Tue, 4 Nov 2025 19:05:52 +0000 (19:05 +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.

(cherry picked from commit 141f68437d33522dd2b4535f358241cb01c9a894)

bin/dig/dighost.c

index 360a3da36b1d9d94c6a1dea4330c82cb5e938db6..d496f72ad585473b79ab50ca01c06b5858442bda 100644 (file)
@@ -3398,6 +3398,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) {