From: Evan Hunt Date: Tue, 10 May 2022 19:48:31 +0000 (-0700) Subject: fixed a possible reference leak in dns_resolver_create() X-Git-Tag: v9.19.2~36^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e8ab719bc2f8794c914e849f82cf06ae128b34f3;p=thirdparty%2Fbind9.git fixed a possible reference leak in dns_resolver_create() If an error occurred while creating the resolver, the mctx could remain attached. --- diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index c75505fa299..fe909eb1bfc 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -10234,10 +10234,6 @@ dns_resolver_create(dns_view_t *view, isc_taskmgr_t *taskmgr, res->quotaresp[dns_quotatype_zone] = DNS_R_DROP; res->quotaresp[dns_quotatype_server] = DNS_R_SERVFAIL; isc_refcount_init(&res->references, 1); - atomic_init(&res->exiting, false); - atomic_init(&res->priming, false); - atomic_init(&res->zspill, 0); - atomic_init(&res->nfctx, 0); ISC_LIST_INIT(res->whenshutdown); ISC_LIST_INIT(res->alternates); @@ -10343,8 +10339,7 @@ cleanup_buckets: dns_badcache_destroy(&res->badcache); cleanup_res: - isc_mem_put(view->mctx, res, sizeof(*res)); - + isc_mem_putanddetach(&res->mctx, res, sizeof(*res)); return (result); }