]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Destroy task first when destroying catzs.
authorOndřej Surý <ondrej@sury.org>
Tue, 30 Oct 2018 12:41:07 +0000 (13:41 +0100)
committerOndřej Surý <ondrej@sury.org>
Tue, 30 Oct 2018 13:01:01 +0000 (14:01 +0100)
    When freeing catzs structures we need to kill the updater task first.
    Otherwise we might race with the updater and there might be a crash
    on shutdown.

lib/dns/catz.c

index 848e42a2b54567b0311aed1c10f398cecd0469c3..ca42a55f7d2b2fd69518332656f6d0d5c9617d64 100644 (file)
@@ -795,7 +795,7 @@ dns_catz_catzs_detach(dns_catz_zones_t **catzsp) {
        *catzsp = NULL;
 
        if (isc_refcount_decrement(&catzs->refs) == 1) {
-               isc_refcount_destroy(&catzs->refs);
+               isc_task_destroy(&catzs->updater);
                DESTROYLOCK(&catzs->lock);
                if (catzs->zones != NULL) {
                        isc_ht_iter_t *iter = NULL;
@@ -815,7 +815,7 @@ dns_catz_catzs_detach(dns_catz_zones_t **catzsp) {
                        INSIST(isc_ht_count(catzs->zones) == 0);
                        isc_ht_destroy(&catzs->zones);
                }
-               isc_task_destroy(&catzs->updater);
+               isc_refcount_destroy(&catzs->refs);
                isc_mem_putanddetach(&catzs->mctx, catzs, sizeof(*catzs));
        }
 }