[9.20] fix: usr: Fix assertion failure when dumping recursing clients

Previously, if a new counter was added to the hashtable
while dumping recursing clients via the `rndc recursing`
command, and `fetches-per-zone` was enabled, an assertion
failure could occur. This has been fixed.

Closes #5200

Backport of MR !10164

Merge branch 'backport-5200-destroy-iterator-inside-the-rwlock-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!10168
This commit is contained in:
Ondřej Surý 2025-02-25 16:58:21 +00:00
commit 5d913c3383

View file

@ -11087,8 +11087,8 @@ dns_resolver_dumpquota(dns_resolver_t *res, isc_buffer_t **buf) {
}
cleanup:
RWUNLOCK(&res->counters_lock, isc_rwlocktype_read);
isc_hashmap_iter_destroy(&it);
RWUNLOCK(&res->counters_lock, isc_rwlocktype_read);
return result;
}