From: Evan Hunt Date: Mon, 11 Jul 2022 23:55:48 +0000 (-0700) Subject: clear fctx->magic and fetch->magic when destroying X-Git-Tag: v9.18.6~27^2 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=b66cd7b2fcabefe36f6c3d825ed0889da47d7924;p=thirdparty%2Fbind9.git clear fctx->magic and fetch->magic when destroying fctx_destroy() and dns_resolver_destroyfetch() did not clear the 'magic' field during destruction. (cherry picked from commit 5ec077e6aad95d654d723862683ae7941d59083c) --- diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 09392f11c93..fc0bbe540a6 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -4366,6 +4366,8 @@ fctx_destroy(fetchctx_t *fctx, bool exiting) { FCTXTRACE("destroy"); + fctx->magic = 0; + res = fctx->res; bucketnum = fctx->bucketnum; @@ -10936,6 +10938,8 @@ dns_resolver_destroyfetch(dns_fetch_t **fetchp) { FTRACE("destroyfetch"); + fetch->magic = 0; + bucketnum = fctx->bucketnum; LOCK(&res->buckets[bucketnum].lock);