From: Ondřej Surý Date: Tue, 30 Oct 2018 12:41:07 +0000 (+0100) Subject: Destroy task first when destroying catzs. X-Git-Tag: v9.13.4~69^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1d111cd2e95393d60b0431935f8d03e4e2cc426;p=thirdparty%2Fbind9.git Destroy task first when destroying catzs. 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. --- diff --git a/lib/dns/catz.c b/lib/dns/catz.c index 848e42a2b54..ca42a55f7d2 100644 --- a/lib/dns/catz.c +++ b/lib/dns/catz.c @@ -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)); } }