From: Ondřej Surý Date: Mon, 18 Aug 2025 15:11:03 +0000 (+0200) Subject: Disassociate added rdataset on error in cache_rrset() X-Git-Tag: v9.21.12~38^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f9647d16e5bbba483134604ac8e51bb97b579dc;p=thirdparty%2Fbind9.git Disassociate added rdataset on error in cache_rrset() When first dns_db_addrdataset() succeeds in cache_rrset(), but the second one fails with error, the added rdataset was kept associated. This caused assertion failure down the pipe in fctx_sendevents(). --- diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 970e6f1708f..f3cadf3a6f0 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -5286,6 +5286,9 @@ cache_rrset(fetchctx_t *fctx, isc_stdtime_t now, dns_name_t *name, if (result == ISC_R_SUCCESS && sigrdataset != NULL) { result = dns_db_addrdataset(fctx->cache, node, NULL, now, sigrdataset, options, addedsig); + if (result != ISC_R_SUCCESS && result != DNS_R_UNCHANGED) { + dns__rdataset_disassociate(added); + } } if (result == DNS_R_UNCHANGED) {