]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
dns_db_setloop called at wrong place on wrong db
authorMark Andrews <marka@isc.org>
Thu, 7 Mar 2024 02:10:23 +0000 (13:10 +1100)
committerMark Andrews <marka@isc.org>
Thu, 7 Mar 2024 02:10:23 +0000 (13:10 +1100)
In cache_create_db, dns_db_setloop should be called on the newly
created db only if the database creation succeeded.

lib/dns/cache.c

index d425316cc463ae4c892706a6f55cd4220f67494d..902ae732e995d8e68d3e98aa6324a9e1b61e6c18 100644 (file)
@@ -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);
 }