Commit 929ea7c2 authored by Witold Krecicki's avatar Witold Krecicki
Browse files

- Make isc_mutex_destroy return void

- Make isc_mutexblock_init/destroy return void
- Minor cleanups
parent d940e952
Pipeline #7118 passed with stages
in 13 minutes and 49 seconds
......@@ -4198,7 +4198,7 @@ destroy_libs(void) {
}
UNLOCK_LOOKUP;
DESTROYLOCK(&lookup_lock);
isc_mutex_destroy(&lookup_lock);
debug("Removing log context");
isc_log_destroy(&lctx);
......
......@@ -3936,9 +3936,9 @@ main(int argc, char *argv[]) {
check_result(result, "dns_master_dumptostream3");
}
DESTROYLOCK(&namelock);
isc_mutex_destroy(&namelock);
if (printstats)
DESTROYLOCK(&statslock);
isc_mutex_destroy(&statslock);
if (!output_stdout) {
result = isc_stdio_close(outfp);
......
......@@ -3226,7 +3226,7 @@ destroy_listener(void *arg) {
/* We don't have to acquire the lock here since it's already unlinked */
dns_acl_detach(&listener->acl);
DESTROYLOCK(&listener->lock);
isc_mutex_destroy(&listener->lock);
isc_mem_putanddetach(&listener->mctx, listener, sizeof(*listener));
}
......@@ -3348,7 +3348,7 @@ cleanup:
if (result != ISC_R_SUCCESS) {
if (listener->acl != NULL)
dns_acl_detach(&listener->acl);
DESTROYLOCK(&listener->lock);
isc_mutex_destroy(&listener->lock);
isc_mem_putanddetach(&listener->mctx, listener,
sizeof(*listener));
}
......
......@@ -362,15 +362,19 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
failed:
dlopen_log(ISC_LOG_ERROR, "dlz_dlopen of '%s' failed", dlzname);
if (cd->dl_path != NULL)
if (cd->dl_path != NULL) {
isc_mem_free(mctx, cd->dl_path);
if (cd->dlzname != NULL)
}
if (cd->dlzname != NULL) {
isc_mem_free(mctx, cd->dlzname);
if (dlopen_flags != 0)
(void) isc_mutex_destroy(&cd->lock);
}
if (dlopen_flags != 0) {
isc_mutex_destroy(&cd->lock);
}
#ifdef HAVE_DLCLOSE
if (cd->dl_handle)
if (cd->dl_handle) {
dlclose(cd->dl_handle);
}
#endif
isc_mem_put(mctx, cd, sizeof(*cd));
isc_mem_destroy(&mctx);
......@@ -393,17 +397,20 @@ dlopen_dlz_destroy(void *driverarg, void *dbdata) {
MAYBE_UNLOCK(cd);
}
if (cd->dl_path)
if (cd->dl_path) {
isc_mem_free(cd->mctx, cd->dl_path);
if (cd->dlzname)
}
if (cd->dlzname) {
isc_mem_free(cd->mctx, cd->dlzname);
}
#ifdef HAVE_DLCLOSE
if (cd->dl_handle)
if (cd->dl_handle) {
dlclose(cd->dl_handle);
}
#endif
(void) isc_mutex_destroy(&cd->lock);
isc_mutex_destroy(&cd->lock);
mctx = cd->mctx;
isc_mem_put(mctx, cd, sizeof(*cd));
......
......@@ -347,17 +347,21 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
return (ISC_R_SUCCESS);
cleanup_lock:
DESTROYLOCK(&cd->lock);
isc_mutex_destroy(&cd->lock);
failed:
dlopen_log(ISC_LOG_ERROR, "dlz_dlopen of '%s' failed", dlzname);
if (cd->dl_path)
if (cd->dl_path) {
isc_mem_free(mctx, cd->dl_path);
if (cd->dlzname)
}
if (cd->dlzname) {
isc_mem_free(mctx, cd->dlzname);
if (triedload)
(void) isc_mutex_destroy(&cd->lock);
if (cd->dl_handle)
}
if (triedload) {
isc_mutex_destroy(&cd->lock);
}
if (cd->dl_handle) {
FreeLibrary(cd->dl_handle);
}
isc_mem_put(mctx, cd, sizeof(*cd));
isc_mem_destroy(&mctx);
return (result);
......@@ -388,7 +392,7 @@ dlopen_dlz_destroy(void *driverarg, void *dbdata) {
if (cd->dl_handle)
FreeLibrary(cd->dl_handle);
DESTROYLOCK(&cd->lock);
isc_mutex_destroy(&cd->lock);
mctx = cd->mctx;
isc_mem_put(mctx, cd, sizeof(*cd));
......
......@@ -114,7 +114,7 @@ main(int argc, char *argv[]) {
isc_mem_destroy(&mctx);
DESTROYLOCK(&lock);
isc_mutex_destroy(&lock);
return (0);
}
......@@ -282,7 +282,7 @@ main(int argc, char *argv[]) {
isc_mem_stats(mctx, stdout);
isc_mem_destroy(&mctx);
DESTROYLOCK(&lock);
isc_mutex_destroy(&lock);
isc_app_finish();
......
......@@ -610,9 +610,7 @@ grow_entries(isc_task_t *task, isc_event_t *ev) {
/*
* Initialise the new resources.
*/
result = isc_mutexblock_init(newentrylocks, n);
if (result != ISC_R_SUCCESS)
goto cleanup;
isc_mutexblock_init(newentrylocks, n);
for (i = 0; i < n; i++) {
ISC_LIST_INIT(newentries[i]);
......@@ -655,7 +653,7 @@ grow_entries(isc_task_t *task, isc_event_t *ev) {
/*
* Cleanup old resources.
*/
DESTROYMUTEXBLOCK(adb->entrylocks, adb->nentries);
isc_mutexblock_destroy(adb->entrylocks, adb->nentries);
isc_mem_put(adb->mctx, adb->entries,
sizeof(*adb->entries) * adb->nentries);
isc_mem_put(adb->mctx, adb->deadentries,
......@@ -767,9 +765,7 @@ grow_names(isc_task_t *task, isc_event_t *ev) {
/*
* Initialise the new resources.
*/
result = isc_mutexblock_init(newnamelocks, n);
if (result != ISC_R_SUCCESS)
goto cleanup;
isc_mutexblock_init(newnamelocks, n);
for (i = 0; i < n; i++) {
ISC_LIST_INIT(newnames[i]);
......@@ -812,7 +808,7 @@ grow_names(isc_task_t *task, isc_event_t *ev) {
/*
* Cleanup old resources.
*/
DESTROYMUTEXBLOCK(adb->namelocks, adb->nnames);
isc_mutexblock_destroy(adb->namelocks, adb->nnames);
isc_mem_put(adb->mctx, adb->names,
sizeof(*adb->names) * adb->nnames);
isc_mem_put(adb->mctx, adb->deadnames,
......@@ -1979,7 +1975,7 @@ free_adbfind(dns_adb_t *adb, dns_adbfind_t **findp) {
find->magic = 0;
DESTROYLOCK(&find->lock);
isc_mutex_destroy(&find->lock);
isc_mempool_put(adb->ahmp, find);
return (dec_adb_irefcnt(adb));
}
......@@ -2475,7 +2471,7 @@ destroy(dns_adb_t *adb) {
isc_mempool_destroy(&adb->aimp);
isc_mempool_destroy(&adb->afmp);
DESTROYMUTEXBLOCK(adb->entrylocks, adb->nentries);
isc_mutexblock_destroy(adb->entrylocks, adb->nentries);
isc_mem_put(adb->mctx, adb->entries,
sizeof(*adb->entries) * adb->nentries);
isc_mem_put(adb->mctx, adb->deadentries,
......@@ -2487,7 +2483,7 @@ destroy(dns_adb_t *adb) {
isc_mem_put(adb->mctx, adb->entry_refcnt,
sizeof(*adb->entry_refcnt) * adb->nentries);
DESTROYMUTEXBLOCK(adb->namelocks, adb->nnames);
isc_mutexblock_destroy(adb->namelocks, adb->nnames);
isc_mem_put(adb->mctx, adb->names,
sizeof(*adb->names) * adb->nnames);
isc_mem_put(adb->mctx, adb->deadnames,
......@@ -2499,12 +2495,12 @@ destroy(dns_adb_t *adb) {
isc_mem_put(adb->mctx, adb->name_refcnt,
sizeof(*adb->name_refcnt) * adb->nnames);
DESTROYLOCK(&adb->reflock);
DESTROYLOCK(&adb->lock);
DESTROYLOCK(&adb->mplock);
DESTROYLOCK(&adb->overmemlock);
DESTROYLOCK(&adb->entriescntlock);
DESTROYLOCK(&adb->namescntlock);
isc_mutex_destroy(&adb->reflock);
isc_mutex_destroy(&adb->lock);
isc_mutex_destroy(&adb->mplock);
isc_mutex_destroy(&adb->overmemlock);
isc_mutex_destroy(&adb->entriescntlock);
isc_mutex_destroy(&adb->namescntlock);
isc_mem_putanddetach(&adb->mctx, adb, sizeof(dns_adb_t));
}
......@@ -2644,9 +2640,8 @@ dns_adb_create(isc_mem_t *mem, dns_view_t *view, isc_timermgr_t *timermgr,
* Initialize the bucket locks for names and elements.
* May as well initialize the list heads, too.
*/
result = isc_mutexblock_init(adb->namelocks, adb->nnames);
if (result != ISC_R_SUCCESS)
goto fail1;
isc_mutexblock_init(adb->namelocks, adb->nnames);
for (i = 0; i < adb->nnames; i++) {
ISC_LIST_INIT(adb->names[i]);
ISC_LIST_INIT(adb->deadnames[i]);
......@@ -2661,9 +2656,7 @@ dns_adb_create(isc_mem_t *mem, dns_view_t *view, isc_timermgr_t *timermgr,
adb->entry_refcnt[i] = 0;
adb->irefcnt++;
}
result = isc_mutexblock_init(adb->entrylocks, adb->nentries);
if (result != ISC_R_SUCCESS)
goto fail2;
isc_mutexblock_init(adb->entrylocks, adb->nentries);
/*
* Memory pools
......@@ -2671,12 +2664,12 @@ dns_adb_create(isc_mem_t *mem, dns_view_t *view, isc_timermgr_t *timermgr,
#define MPINIT(t, p, n) do { \
result = isc_mempool_create(mem, sizeof(t), &(p)); \
if (result != ISC_R_SUCCESS) \
goto fail3; \
goto fail2; \
isc_mempool_setfreemax((p), FREE_ITEMS); \
isc_mempool_setfillcount((p), FILL_COUNT); \
isc_mempool_setname((p), n); \
isc_mempool_associatelock((p), &adb->mplock); \
} while (0)
} while (0)
MPINIT(dns_adbname_t, adb->nmp, "adbname");
MPINIT(dns_adbnamehook_t, adb->nhmp, "adbnamehook");
......@@ -2693,13 +2686,13 @@ dns_adb_create(isc_mem_t *mem, dns_view_t *view, isc_timermgr_t *timermgr,
*/
result = isc_task_create(adb->taskmgr, 0, &adb->task);
if (result != ISC_R_SUCCESS)
goto fail3;
goto fail2;
isc_task_setname(adb->task, "ADB", adb);
result = isc_stats_create(adb->mctx, &view->adbstats, dns_adbstats_max);
if (result != ISC_R_SUCCESS)
goto fail3;
goto fail2;
set_adbstat(adb, adb->nentries, dns_adbstats_nentries);
set_adbstat(adb, adb->nnames, dns_adbstats_nnames);
......@@ -2711,15 +2704,13 @@ dns_adb_create(isc_mem_t *mem, dns_view_t *view, isc_timermgr_t *timermgr,
*newadb = adb;
return (ISC_R_SUCCESS);
fail3:
fail2:
if (adb->task != NULL)
isc_task_detach(&adb->task);
/* clean up entrylocks */
DESTROYMUTEXBLOCK(adb->entrylocks, adb->nentries);
fail2: /* clean up namelocks */
DESTROYMUTEXBLOCK(adb->namelocks, adb->nnames);
isc_mutexblock_destroy(adb->entrylocks, adb->nentries);
isc_mutexblock_destroy(adb->namelocks, adb->nnames);
fail1: /* clean up only allocated memory */
if (adb->entries != NULL)
......@@ -2767,12 +2758,12 @@ dns_adb_create(isc_mem_t *mem, dns_view_t *view, isc_timermgr_t *timermgr,
if (adb->afmp != NULL)
isc_mempool_destroy(&adb->afmp);
DESTROYLOCK(&adb->namescntlock);
DESTROYLOCK(&adb->entriescntlock);
DESTROYLOCK(&adb->overmemlock);
DESTROYLOCK(&adb->reflock);
DESTROYLOCK(&adb->mplock);
DESTROYLOCK(&adb->lock);
isc_mutex_destroy(&adb->namescntlock);
isc_mutex_destroy(&adb->entriescntlock);
isc_mutex_destroy(&adb->overmemlock);
isc_mutex_destroy(&adb->reflock);
isc_mutex_destroy(&adb->mplock);
isc_mutex_destroy(&adb->lock);
if (adb->excl != NULL)
isc_task_detach(&adb->excl);
isc_mem_putanddetach(&adb->mctx, adb, sizeof(dns_adb_t));
......
......@@ -94,7 +94,7 @@ dns_badcache_init(isc_mem_t *mctx, unsigned int size, dns_badcache_t **bcp) {
return (ISC_R_SUCCESS);
destroy_lock:
DESTROYLOCK(&bc->lock);
isc_mutex_destroy(&bc->lock);
isc_mem_putanddetach(&bc->mctx, bc, sizeof(dns_badcache_t));
return (result);
}
......@@ -109,7 +109,7 @@ dns_badcache_destroy(dns_badcache_t **bcp) {
dns_badcache_flush(bc);
bc->magic = 0;
DESTROYLOCK(&bc->lock);
isc_mutex_destroy(&bc->lock);
isc_mem_put(bc->mctx, bc->table, sizeof(dns_bcentry_t *) * bc->size);
isc_mem_putanddetach(&bc->mctx, bc, sizeof(dns_badcache_t));
*bcp = NULL;
......
......@@ -248,7 +248,7 @@ dns_byaddr_create(isc_mem_t *mctx, const isc_netaddr_t *address,
return (ISC_R_SUCCESS);
cleanup_lock:
DESTROYLOCK(&byaddr->lock);
isc_mutex_destroy(&byaddr->lock);
ievent = (isc_event_t *)byaddr->event;
isc_event_free(&ievent);
......@@ -288,7 +288,7 @@ dns_byaddr_destroy(dns_byaddr_t **byaddrp) {
REQUIRE(byaddr->task == NULL);
dns_lookup_destroy(&byaddr->lookup);
DESTROYLOCK(&byaddr->lock);
isc_mutex_destroy(&byaddr->lock);
byaddr->magic = 0;
isc_mem_putanddetach(&byaddr->mctx, byaddr, sizeof(*byaddr));
......
......@@ -320,10 +320,10 @@ cleanup_dbargv:
cleanup_dbtype:
isc_mem_free(cmctx, cache->db_type);
cleanup_filelock:
DESTROYLOCK(&cache->filelock);
isc_mutex_destroy(&cache->filelock);
cleanup_stats:
isc_stats_detach(&cache->stats);
DESTROYLOCK(&cache->lock);
isc_mutex_destroy(&cache->lock);
cleanup_mem:
if (cache->name != NULL) {
isc_mem_free(cmctx, cache->name);
......@@ -354,7 +354,7 @@ cache_free(dns_cache_t *cache) {
if (cache->cleaner.iterator != NULL)
dns_dbiterator_destroy(&cache->cleaner.iterator);
DESTROYLOCK(&cache->cleaner.lock);
isc_mutex_destroy(&cache->cleaner.lock);
if (cache->filename) {
isc_mem_free(cache->mctx, cache->filename);
......@@ -388,8 +388,8 @@ cache_free(dns_cache_t *cache) {
if (cache->stats != NULL)
isc_stats_detach(&cache->stats);
DESTROYLOCK(&cache->lock);
DESTROYLOCK(&cache->filelock);
isc_mutex_destroy(&cache->lock);
isc_mutex_destroy(&cache->filelock);
cache->magic = 0;
isc_mem_detach(&cache->hmctx);
......@@ -679,7 +679,7 @@ cache_cleaner_init(dns_cache_t *cache, isc_taskmgr_t *taskmgr,
isc_task_detach(&cleaner->task);
if (cleaner->iterator != NULL)
dns_dbiterator_destroy(&cleaner->iterator);
DESTROYLOCK(&cleaner->lock);
isc_mutex_destroy(&cleaner->lock);
return (result);
}
......
......@@ -793,7 +793,7 @@ dns_catz_catzs_detach(dns_catz_zones_t **catzsp) {
if (isc_refcount_decrement(&catzs->refs) == 1) {
isc_task_destroy(&catzs->updater);
DESTROYLOCK(&catzs->lock);
isc_mutex_destroy(&catzs->lock);
if (catzs->zones != NULL) {
isc_ht_iter_t *iter = NULL;
isc_result_t result;
......
......@@ -573,7 +573,7 @@ destroyclient(dns_client_t **clientp) {
isc_appctx_destroy(&client->actx);
}
DESTROYLOCK(&client->lock);
isc_mutex_destroy(&client->lock);
client->magic = 0;
isc_mem_putanddetach(&client->mctx, client, sizeof(*client));
......@@ -1208,7 +1208,7 @@ resolve_done(isc_task_t *task, isc_event_t *event) {
* unexpected event). Just clean the arg up.
*/
UNLOCK(&resarg->lock);
DESTROYLOCK(&resarg->lock);
isc_mutex_destroy(&resarg->lock);
isc_mem_put(resarg->client->mctx, resarg, sizeof(*resarg));
}
}
......@@ -1252,7 +1252,7 @@ dns_client_resolve(dns_client_t *client, const dns_name_t *name,
client->task, resolve_done, resarg,
&resarg->trans);
if (result != ISC_R_SUCCESS) {
DESTROYLOCK(&resarg->lock);
isc_mutex_destroy(&resarg->lock);
isc_mem_put(client->mctx, resarg, sizeof(*resarg));
return (result);
}
......@@ -1288,7 +1288,7 @@ dns_client_resolve(dns_client_t *client, const dns_name_t *name,
} else {
UNLOCK(&resarg->lock);
DESTROYLOCK(&resarg->lock);
isc_mutex_destroy(&resarg->lock);
isc_mem_put(client->mctx, resarg, sizeof(*resarg));
}
......@@ -1402,7 +1402,7 @@ dns_client_startresolve(dns_client_t *client, const dns_name_t *name,
if (sigrdataset != NULL)
putrdataset(client->mctx, &sigrdataset);
if (rctx != NULL) {
DESTROYLOCK(&rctx->lock);
isc_mutex_destroy(&rctx->lock);
isc_mem_put(mctx, rctx, sizeof(*rctx));
}
if (event != NULL)
......@@ -1490,7 +1490,7 @@ dns_client_destroyrestrans(dns_clientrestrans_t **transp) {
INSIST(ISC_LIST_EMPTY(rctx->namelist));
DESTROYLOCK(&rctx->lock);
isc_mutex_destroy(&rctx->lock);
rctx->magic = 0;
isc_mem_put(mctx, rctx, sizeof(*rctx));
......@@ -1608,7 +1608,7 @@ localrequest_done(isc_task_t *task, isc_event_t *event) {
* unexpected event). Just clean the arg up.
*/
UNLOCK(&reqarg->lock);
DESTROYLOCK(&reqarg->lock);
isc_mutex_destroy(&reqarg->lock);
isc_mem_put(reqarg->client->mctx, reqarg, sizeof(*reqarg));
}
}
......@@ -1656,7 +1656,7 @@ dns_client_request(dns_client_t *client, dns_message_t *qmessage,
client->task, localrequest_done,
reqarg, &reqarg->trans);
if (result != ISC_R_SUCCESS) {
DESTROYLOCK(&reqarg->lock);
isc_mutex_destroy(&reqarg->lock);
isc_mem_put(client->mctx, reqarg, sizeof(*reqarg));
return (result);
}
......@@ -1684,7 +1684,7 @@ dns_client_request(dns_client_t *client, dns_message_t *qmessage,
} else {
UNLOCK(&reqarg->lock);
DESTROYLOCK(&reqarg->lock);
isc_mutex_destroy(&reqarg->lock);
isc_mem_put(client->mctx, reqarg, sizeof(*reqarg));
}
......@@ -1783,7 +1783,7 @@ dns_client_startrequest(dns_client_t *client, dns_message_t *qmessage,
LOCK(&client->lock);
ISC_LIST_UNLINK(client->reqctxs, ctx, link);
UNLOCK(&client->lock);
DESTROYLOCK(&ctx->lock);
isc_mutex_destroy(&ctx->lock);
isc_mem_put(client->mctx, ctx, sizeof(*ctx));
}
if (event != NULL)
......@@ -1844,7 +1844,7 @@ dns_client_destroyreqtrans(dns_clientreqtrans_t **transp) {
UNLOCK(&client->lock);
DESTROYLOCK(&ctx->lock);
isc_mutex_destroy(&ctx->lock);
ctx->magic = 0;
isc_mem_put(mctx, ctx, sizeof(*ctx));
......@@ -2662,7 +2662,7 @@ internal_update_callback(isc_task_t *task, isc_event_t *event) {
* unexpected event). Just clean the arg up.
*/
UNLOCK(&uarg->lock);
DESTROYLOCK(&uarg->lock);
isc_mutex_destroy(&uarg->lock);
isc_mem_put(uarg->client->mctx, uarg, sizeof(*uarg));
}
}
......@@ -2708,7 +2708,7 @@ dns_client_update(dns_client_t *client, dns_rdataclass_t rdclass,
internal_update_callback, uarg,
&uarg->trans);
if (result != ISC_R_SUCCESS) {
DESTROYLOCK(&uarg->lock);
isc_mutex_destroy(&uarg->lock);
isc_mem_put(client->mctx, uarg, sizeof(*uarg));
return (result);
}
......@@ -2737,7 +2737,7 @@ dns_client_update(dns_client_t *client, dns_rdataclass_t rdclass,
} else {
UNLOCK(&uarg->lock);
DESTROYLOCK(&uarg->lock);
isc_mutex_destroy(&uarg->lock);
isc_mem_put(client->mctx, uarg, sizeof(*uarg));
}
......@@ -2975,7 +2975,7 @@ dns_client_startupdate(dns_client_t *client, dns_rdataclass_t rdclass,
if (uctx->tsigkey != NULL)
dns_tsigkey_detach(&uctx->tsigkey);
isc_task_detach(&tclone);
DESTROYLOCK(&uctx->lock);
isc_mutex_destroy(&uctx->lock);
uctx->magic = 0;
isc_mem_put(client->mctx, uctx, sizeof(*uctx));
dns_view_detach(&view);
......@@ -3045,7 +3045,7 @@ dns_client_destroyupdatetrans(dns_clientupdatetrans_t **transp) {
UNLOCK(&client->lock);
DESTROYLOCK(&uctx->lock);
isc_mutex_destroy(&uctx->lock);
uctx->magic = 0;
isc_mem_put(mctx, uctx, sizeof(*uctx));
......
......@@ -85,7 +85,7 @@ dns_dbtable_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
return (ISC_R_SUCCESS);
clean3:
DESTROYLOCK(&dbtable->lock);
isc_mutex_destroy(&dbtable->lock);
dns_rbt_destroy(&dbtable->rbt);
......
......@@ -526,7 +526,7 @@ destroy_disp(isc_task_t *task, isc_event_t *event) {
if (disp->sepool != NULL) {
isc_mempool_destroy(&disp->sepool);
(void)isc_mutex_destroy(&disp->sepool_lock);
isc_mutex_destroy(&disp->sepool_lock);
}
if (disp->socket != NULL)
......@@ -1625,7 +1625,7 @@ destroy_mgr(dns_dispatchmgr_t **mgrp) {
mgr->magic = 0;
mgr->mctx = NULL;
DESTROYLOCK(&mgr->lock);
isc_mutex_destroy(&mgr->lock);
mgr->state = 0;
isc_mempool_destroy(&mgr->depool);
......@@ -1636,16 +1636,16 @@ destroy_mgr(dns_dispatchmgr_t **mgrp) {
if (mgr->spool != NULL)
isc_mempool_destroy(&mgr->spool);
DESTROYLOCK(&mgr->spool_lock);
DESTROYLOCK(&mgr->bpool_lock);
DESTROYLOCK(&mgr->dpool_lock);
DESTROYLOCK(&mgr->rpool_lock);
DESTROYLOCK(&mgr->depool_lock);
isc_mutex_destroy(&mgr->spool_lock);
isc_mutex_destroy(&mgr->bpool_lock);
isc_mutex_destroy(&mgr->dpool_lock);
isc_mutex_destroy(&mgr->rpool_lock);
isc_mutex_destroy(&mgr->depool_lock);
if (mgr->qid != NULL)
qid_destroy(mctx, &mgr->qid);
DESTROYLOCK(&mgr->buffer_lock);
isc_mutex_destroy(&mgr->buffer_lock);
if (mgr->blackhole != NULL)
dns_acl_detach(&mgr->blackhole);
......@@ -1772,7 +1772,7 @@ dns_dispatchmgr_create(isc_mem_t *mctx, dns_dispatchmgr_t **mgrp)
if (isc_mempool_create(mgr->mctx, sizeof(dns_dispatchevent_t),
&mgr->depool) != ISC_R_SUCCESS) {