diff --git a/CHANGES b/CHANGES index 3451a38c85..8d26051d1f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +5776. [bug] Add a missing isc_condition_destroy() for nmsocket + condition variable and add missing isc_mutex_destroy() + for nmworker lock. [GL #3051] + 5775. [bug] Added a timer in the resolver to kill fetches that have deadlocked as a result of dependency loops with the ADB or the validator. This condition is diff --git a/doc/notes/notes-current.rst b/doc/notes/notes-current.rst index 3e6b31f3d6..9480b5fae8 100644 --- a/doc/notes/notes-current.rst +++ b/doc/notes/notes-current.rst @@ -79,3 +79,6 @@ Bug Fixes - The resolver could hang on shutdown due to dispatch resources not being cleaned up when a TCP connection was reset. This has been fixed. :gl:`#3026` + +- On FreeBSD, a TCP connection would leak a small amount of heap memory leading + to out-of-memory problem in a long run. This has been fixed. :gl:`#3051` diff --git a/lib/isc/netmgr/netmgr.c b/lib/isc/netmgr/netmgr.c index 13168683e1..51045521a1 100644 --- a/lib/isc/netmgr/netmgr.c +++ b/lib/isc/netmgr/netmgr.c @@ -379,6 +379,7 @@ nm_destroy(isc_nm_t **mgr0) { isc_mem_put(mgr->mctx, ievent, sizeof(*ievent)); } isc_condition_destroy(&worker->cond_prio); + isc_mutex_destroy(&worker->lock); r = uv_loop_close(&worker->loop); INSIST(r == 0); @@ -1271,8 +1272,9 @@ nmsocket_cleanup(isc_nmsocket_t *sock, bool dofree FLARG) { sock->ah_size * sizeof(sock->ah_frees[0])); isc_mem_put(sock->mgr->mctx, sock->ah_handles, sock->ah_size * sizeof(sock->ah_handles[0])); - isc_mutex_destroy(&sock->lock); isc_condition_destroy(&sock->scond); + isc_condition_destroy(&sock->cond); + isc_mutex_destroy(&sock->lock); #if HAVE_LIBNGHTTP2 isc__nm_tls_cleanup_data(sock); isc__nm_http_cleanup_data(sock);