mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-16 23:48:53 -04:00
Add missing isc_mutex_destroy and isc_conditional_destroy calls.
While harmless on Linux, missing isc_{mutex,conditional}_destroy
causes a memory leak on *BSD. Missing calls were added.
(cherry picked from commit a8807d9a7b)
This commit is contained in:
parent
b46faa1b04
commit
4ceddeee78
3 changed files with 9 additions and 0 deletions
|
|
@ -10087,6 +10087,7 @@ named_server_destroy(named_server_t **serverp) {
|
|||
dst_lib_destroy();
|
||||
|
||||
isc_event_free(&server->reload_event);
|
||||
isc_mutex_destroy(&server->reload_event_lock);
|
||||
|
||||
INSIST(ISC_LIST_EMPTY(server->kasplist));
|
||||
INSIST(ISC_LIST_EMPTY(server->viewlist));
|
||||
|
|
|
|||
|
|
@ -276,6 +276,9 @@ nm_destroy(isc_nm_t **mgr0) {
|
|||
|
||||
isc_queue_destroy(worker->ievents);
|
||||
isc_queue_destroy(worker->ievents_prio);
|
||||
isc_mutex_destroy(&worker->lock);
|
||||
isc_condition_destroy(&worker->cond);
|
||||
|
||||
isc_mem_put(mgr->mctx, worker->recvbuf,
|
||||
ISC_NETMGR_RECVBUF_SIZE);
|
||||
isc_thread_join(worker->thread, NULL);
|
||||
|
|
@ -771,6 +774,8 @@ nmsocket_cleanup(isc_nmsocket_t *sock, bool dofree) {
|
|||
|
||||
isc_mem_free(sock->mgr->mctx, sock->ah_frees);
|
||||
isc_mem_free(sock->mgr->mctx, sock->ah_handles);
|
||||
isc_mutex_destroy(&sock->lock);
|
||||
isc_condition_destroy(&sock->cond);
|
||||
|
||||
if (dofree) {
|
||||
isc_nm_t *mgr = sock->mgr;
|
||||
|
|
|
|||
|
|
@ -1356,9 +1356,12 @@ static void
|
|||
manager_free(isc__taskmgr_t *manager) {
|
||||
for (unsigned int i = 0; i < manager->workers; i++) {
|
||||
isc_mutex_destroy(&manager->queues[i].lock);
|
||||
isc_condition_destroy(&manager->queues[i].work_available);
|
||||
}
|
||||
isc_mutex_destroy(&manager->lock);
|
||||
isc_mutex_destroy(&manager->excl_lock);
|
||||
isc_mutex_destroy(&manager->halt_lock);
|
||||
isc_condition_destroy(&manager->halt_cond);
|
||||
isc_mem_put(manager->mctx, manager->queues,
|
||||
manager->workers * sizeof(isc__taskqueue_t));
|
||||
manager->common.impmagic = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue