]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add isc_refcount_destroy() for dns_zt reference counters
authorOndřej Surý <ondrej@isc.org>
Mon, 3 Jan 2022 20:37:54 +0000 (21:37 +0100)
committerOndřej Surý <ondrej@isc.org>
Wed, 5 Jan 2022 15:56:16 +0000 (16:56 +0100)
The zt_destroy() function was missing isc_refcount_destroy() on the two
reference counters.  The isc_refcount_destroy() adds proper memory
ordering on destroy and also ensures that the reference counters have
been zeroed before destroying the object.

lib/dns/zt.c

index d4ff6fa53fa4f765cc6b7fddeeb1e8c47e244264..2c569dde13e7939b66ca18b1dc13264f51c9c0e6 100644 (file)
@@ -222,6 +222,9 @@ flush(dns_zone_t *zone, void *uap) {
 
 static void
 zt_destroy(dns_zt_t *zt) {
+       isc_refcount_destroy(&zt->references);
+       isc_refcount_destroy(&zt->loads_pending);
+
        if (atomic_load_acquire(&zt->flush)) {
                (void)dns_zt_apply(zt, false, NULL, flush, NULL);
        }