From: Ondřej Surý Date: Tue, 4 Apr 2023 08:26:41 +0000 (+0200) Subject: Don't detach xfr in dns_xfrin_shutdown() X-Git-Tag: v9.19.12~20^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=05bb89267ebdf8337e5b24f362aee49ee3018942;p=thirdparty%2Fbind9.git Don't detach xfr in dns_xfrin_shutdown() As we are now using dispatch instead of netmgr for XFR TCP connection, the xfrin_recv_done() will be called when cancelling the dispatch with ISC_R_CANCELED. This could lead to double detach from the dns_xfrin_t, one in the xfrin_recv_done() and one in the dns_xfrin_shutdown(). Remove the extra detach from the dns_xfrin_shutdown() and rely on the dispatch read callback to be always called. --- diff --git a/lib/dns/xfrin.c b/lib/dns/xfrin.c index 9f347772b7a..99190cc385e 100644 --- a/lib/dns/xfrin.c +++ b/lib/dns/xfrin.c @@ -742,9 +742,6 @@ dns_xfrin_shutdown(dns_xfrin_t *xfr) { REQUIRE(VALID_XFRIN(xfr)); xfrin_fail(xfr, ISC_R_CANCELED, "shut down"); - - /* we won't reach xfrin_recv_done(), so dereference xfr here */ - dns_xfrin_unref(xfr); } #if DNS_XFRIN_TRACE