]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix missing mutex destroy and ede invalidate on fctx_create() error paths
authorOndřej Surý <ondrej@isc.org>
Tue, 10 Mar 2026 10:30:54 +0000 (11:30 +0100)
committerOndřej Surý <ondrej@isc.org>
Tue, 17 Mar 2026 15:05:11 +0000 (16:05 +0100)
The error cleanup in fctx_create() was missing isc_mutex_destroy() and
dns_ede_invalidate() calls. When error paths (cleanup_nameservers,
cleanup_fcount, cleanup_qmessage, cleanup_adb) were taken after the
mutex and edectx were initialized, the fctx memory was freed without
properly destroying these resources first.

lib/dns/resolver.c

index 20763e612c41d349fce07c245cb99e110c6bda4e..a708bd0f0b109aba0a041b35b4685487a0fa6a64 100644 (file)
@@ -5121,6 +5121,8 @@ cleanup_nameservers:
                fetchctx_detach(&fctx->parent);
        }
 
+       dns_ede_invalidate(&fctx->edectx);
+       isc_mutex_destroy(&fctx->lock);
        dns_resolver_detach(&fctx->res);
        isc_mem_putanddetach(&fctx->mctx, fctx, sizeof(*fctx));