From: JINMEI Tatuya Date: Thu, 30 Oct 2025 00:51:59 +0000 (-0700) Subject: make sure current_query is detached before trying next server X-Git-Tag: v9.21.15~9^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=141f68437d33522dd2b4535f358241cb01c9a894;p=thirdparty%2Fbind9.git make sure current_query is detached before trying next server 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. --- diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 5928c265bd8..c3516456360 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -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) {