2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00: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.
This commit is contained in:
Witold Kręcicki
2020-05-28 12:34:37 +02:00
committed by Ondřej Surý
parent 146748f5c6
commit a8807d9a7b
3 changed files with 9 additions and 0 deletions

View File

@@ -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;