]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
disassociate rdatasets when cleaning up
authorMark Andrews <marka@isc.org>
Tue, 21 Dec 2021 01:44:17 +0000 (12:44 +1100)
committerMark Andrews <marka@isc.org>
Thu, 14 Jul 2022 00:21:47 +0000 (10:21 +1000)
free_namelist could be passed names with associated rdatasets
when handling errors.  These need to be disassociated before
calling dns_message_puttemprdataset.

(cherry picked from commit 745d5edc3a8ca6f232b2d700ae076c2caee2bfc5)

lib/dns/tkey.c

index e6e44526a9ce42c81f9411aa3058a1cd858131d6..9259a5131885df328a42b9f176994004ee48cbb8 100644 (file)
@@ -226,6 +226,9 @@ free_namelist(dns_message_t *msg, dns_namelist_t *namelist) {
                while (!ISC_LIST_EMPTY(name->list)) {
                        set = ISC_LIST_HEAD(name->list);
                        ISC_LIST_UNLINK(name->list, set, link);
+                       if (dns_rdataset_isassociated(set)) {
+                               dns_rdataset_disassociate(set);
+                       }
                        dns_message_puttemprdataset(msg, &set);
                }
                dns_message_puttempname(msg, &name);