]> 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@sury.org>
Tue, 17 Mar 2026 22:26:28 +0000 (23:26 +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.

(cherry picked from commit 5b1750f15fe9e5b7914419dab23bef1e7e72d13e)

lib/dns/resolver.c

index 24e2d8f1f0d23e96827fb307ccf57be462c1b4bd..d114180401c644c80082bdd504091906efea4535 100644 (file)
@@ -4967,6 +4967,9 @@ cleanup_nameservers:
        }
 
 cleanup_fetch:
+
+       dns_ede_invalidate(&fctx->edectx);
+       isc_mutex_destroy(&fctx->lock);
        dns_resolver_detach(&fctx->res);
        isc_mem_putanddetach(&fctx->mctx, fctx, sizeof(*fctx));