From: Mark Andrews Date: Thu, 25 Jun 2015 08:36:27 +0000 (+1000) Subject: 4146. [bug] Address reference leak that could prevent a clean X-Git-Tag: v9.11.0a1~706 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=adbf81335b67be0cebdcf9f1f4fcb38ef4814f4d;p=thirdparty%2Fbind9.git 4146. [bug] Address reference leak that could prevent a clean shutdown. [RT #37125] --- diff --git a/CHANGES b/CHANGES index 0b3373f831a..38ae0d8f3b0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +4146. [bug] Address reference leak that could prevent a clean + shutdown. [RT #37125] + 4145. [bug] Not all unassociated adb entries where being printed. [RT #37125] diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 48a7aa85acd..e6dde5cbafa 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -1686,6 +1686,11 @@ fctx_query(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo, if (query->dispatch != NULL) dns_dispatch_detach(&query->dispatch); + LOCK(&res->buckets[fctx->bucketnum].lock); + INSIST(fctx->references > 1); + fctx->references--; + UNLOCK(&res->buckets[fctx->bucketnum].lock); + cleanup_query: if (query->connects == 0) { query->magic = 0;