]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix tkey.c:buildquery() function's error handling
authorAram Sargsyan <aram@isc.org>
Mon, 15 Aug 2022 11:40:21 +0000 (11:40 +0000)
committerAram Sargsyan <aram@isc.org>
Wed, 17 Aug 2022 08:36:07 +0000 (08:36 +0000)
Add the missing cleanup code.

(cherry picked from commit 4237ab9550eeaea7121e3e3392fd14c26b5150f0)

lib/dns/tkey.c

index 3ab0565e34876a3480303d50a5cc29beebdfbaf7..de2a0a8d30a7ab8c8e94f536de0329d2ab773fef 100644 (file)
@@ -1020,6 +1020,18 @@ failure:
        if (dynbuf != NULL) {
                isc_buffer_free(&dynbuf);
        }
+       if (rdata != NULL) {
+               dns_message_puttemprdata(msg, &rdata);
+       }
+       if (tkeylist != NULL) {
+               dns_message_puttemprdatalist(msg, &tkeylist);
+       }
+       if (tkeyset != NULL) {
+               if (dns_rdataset_isassociated(tkeyset)) {
+                       dns_rdataset_disassociate(tkeyset);
+               }
+               dns_message_puttemprdataset(msg, &tkeyset);
+       }
        return (result);
 }