INSIST that active quota is 0 in destroy_adbentry()

This should catch ADB quota management errors in the resolver.
This commit is contained in:
Aram Sargsyan 2022-12-22 13:43:47 +00:00 committed by Arаm Sаrgsyаn
parent c4097ec5d5
commit c7ba26c3d6

View 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);
}