From 6b2e7203ae5c90fb9fb1ef353fdc18372f36d11f Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Tue, 26 Jan 2021 20:39:28 -0700 Subject: [PATCH] Fix a resource leak in uu_avl_pool_destroy Need to destroy the pthread mutex created in uu_avl_pool_create. https://svnweb.freebsd.org/base?view=revision&revision=262912 Obtained from: FreeBSD Sponsored by: Spectra Logic Corporation Reviewed-by: Ryan Moeller Reviewed-by: Brian Behlendorf Signed-off-by: Alan Somers Closes #11528 --- lib/libuutil/uu_avl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libuutil/uu_avl.c b/lib/libuutil/uu_avl.c index 040008883a..53def0e073 100644 --- a/lib/libuutil/uu_avl.c +++ b/lib/libuutil/uu_avl.c @@ -128,6 +128,7 @@ uu_avl_pool_destroy(uu_avl_pool_t *pp) pp->uap_next->uap_prev = pp->uap_prev; pp->uap_prev->uap_next = pp->uap_next; (void) pthread_mutex_unlock(&uu_apool_list_lock); + (void) pthread_mutex_destroy(&pp->uap_lock); pp->uap_prev = NULL; pp->uap_next = NULL; uu_free(pp);