From b7c362738d919e0960ae1e3ceeefbf4f7668bc62 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 6 Oct 2021 18:32:19 +1100 Subject: [PATCH] Correctly call dns_dispatch_done() in dns_dispatch_cancel() Pass '&resp' rather than 'respp' as we have already cleared '*respp' when we took ownership of 'resp'. --- lib/dns/dispatch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/dns/dispatch.c b/lib/dns/dispatch.c index c702656431..3e0daa02f2 100644 --- a/lib/dns/dispatch.c +++ b/lib/dns/dispatch.c @@ -1482,6 +1482,7 @@ dns_dispatch_cancel(dns_dispentry_t **respp) { REQUIRE(respp != NULL); resp = *respp; + *respp = NULL; REQUIRE(VALID_RESPONSE(resp)); @@ -1530,7 +1531,7 @@ dns_dispatch_cancel(dns_dispentry_t **respp) { } done: - dns_dispatch_done(respp); + dns_dispatch_done(&resp); } void