From 963f6a22038734fd30284c6a1f4efbdf5f5d5ebc Mon Sep 17 00:00:00 2001 From: Aram Sargsyan Date: Mon, 7 Mar 2022 11:24:09 +0000 Subject: [PATCH] Fix a function cleanup bug in dns_request_createraw When get_dispatch() returns an error code, the dns_request_createraw() function jumps to the `cleanup` label, which will leave a previous attachment to the `request` pointer unattached. Fix the issue by jumping to the `detach` label instead. --- lib/dns/request.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dns/request.c b/lib/dns/request.c index 49a95e1162..f0047b145b 100644 --- a/lib/dns/request.c +++ b/lib/dns/request.c @@ -558,7 +558,7 @@ again: result = get_dispatch(tcp, newtcp, requestmgr, srcaddr, destaddr, dscp, &connected, &request->dispatch); if (result != ISC_R_SUCCESS) { - goto cleanup; + goto detach; } if ((options & DNS_REQUESTOPT_FIXEDID) != 0) {