]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
clear fctx->magic and fetch->magic when destroying
authorEvan Hunt <each@isc.org>
Mon, 11 Jul 2022 23:55:48 +0000 (16:55 -0700)
committerMark Andrews <marka@isc.org>
Wed, 13 Jul 2022 02:12:35 +0000 (02:12 +0000)
fctx_destroy() and dns_resolver_destroyfetch() did not clear the
'magic' field during destruction.

(cherry picked from commit 5ec077e6aad95d654d723862683ae7941d59083c)

lib/dns/resolver.c

index 09392f11c93a4660ec5228aed4ec53c632c4e10a..fc0bbe540a6453450110228d7b14e930745cce82 100644 (file)
@@ -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);