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 5ec077e6aa)
This commit is contained in:
Evan Hunt 2022-07-11 16:55:48 -07:00 committed by Mark Andrews
parent b8d5763494
commit b66cd7b2fc

View 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);