From: Mark Andrews Date: Thu, 7 Mar 2024 02:10:23 +0000 (+1100) Subject: dns_db_setloop called at wrong place on wrong db X-Git-Tag: v9.19.22~5^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=926d2e4cf2d9c0e9cbad0d11e81d95bb500d653b;p=thirdparty%2Fbind9.git dns_db_setloop called at wrong place on wrong db In cache_create_db, dns_db_setloop should be called on the newly created db only if the database creation succeeded. --- diff --git a/lib/dns/cache.c b/lib/dns/cache.c index d425316cc46..902ae732e99 100644 --- a/lib/dns/cache.c +++ b/lib/dns/cache.c @@ -101,10 +101,9 @@ cache_create_db(dns_cache_t *cache, dns_db_t **db) { if (result == ISC_R_SUCCESS) { dns_db_setservestalettl(*db, cache->serve_stale_ttl); dns_db_setservestalerefresh(*db, cache->serve_stale_refresh); + dns_db_setloop(*db, cache->loop); } - dns_db_setloop(cache->db, cache->loop); - return (result); }