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)
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);