]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix a function cleanup bug in dns_request_createraw
authorAram Sargsyan <aram@isc.org>
Mon, 7 Mar 2022 11:24:09 +0000 (11:24 +0000)
committerAram Sargsyan <aram@isc.org>
Mon, 7 Mar 2022 11:24:09 +0000 (11:24 +0000)
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

index 49a95e11625b692b8d2189c1deb397ecf4cc6073..f0047b145b405ac0c340613681e04c9bd0c9037d 100644 (file)
@@ -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) {