]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
INSIST that active quota is 0 in destroy_adbentry()
authorAram Sargsyan <aram@isc.org>
Thu, 22 Dec 2022 13:43:47 +0000 (13:43 +0000)
committerArаm Sаrgsyаn <aram@isc.org>
Fri, 23 Dec 2022 09:45:20 +0000 (09:45 +0000)
This should catch ADB quota management errors in the resolver.

lib/dns/adb.c

index d096c6185de32bf579275f1f033182b3b3c7aa7e..523f5709d410357c1e039efc072612506825e8ca 100644 (file)
@@ -1173,11 +1173,15 @@ destroy_adbentry(dns_adbentry_t *entry) {
 
        dns_adblameinfo_t *li = NULL;
        dns_adb_t *adb = entry->adb;
+       uint_fast32_t active;
 
        entry->magic = 0;
 
        INSIST(ISC_LIST_EMPTY(entry->nhs));
 
+       active = atomic_load_acquire(&entry->active);
+       INSIST(active == 0);
+
        if (entry->cookie != NULL) {
                isc_mem_put(adb->mctx, entry->cookie, entry->cookielen);
        }