Each dns__nta_t now references its parent ntatable in nta_create() and
releases it in dns__nta_destroy(). This avoids a use-after-free in
fetch_done() and other callbacks that dereference nta->ntatable: the
ntatable could otherwise be released by view destruction while an
in-flight resolver fetch still holds a reference to the NTA.
REQUIRE(nta->timer == NULL);
nta->magic = 0;
+ dns_ntatable_detach(&nta->ntatable);
dns_rdataset_cleanup(&nta->rdataset);
dns_rdataset_cleanup(&nta->sigrdataset);
if (nta->fetch != NULL) {
nta = isc_mem_get(ntatable->mctx, sizeof(dns__nta_t));
*nta = (dns__nta_t){
- .ntatable = ntatable,
+ .ntatable = dns_ntatable_ref(ntatable),
.name = DNS_NAME_INITEMPTY,
.magic = NTA_MAGIC,
};