aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Somers <[email protected]>2021-01-26 20:39:28 -0700
committerGitHub <[email protected]>2021-01-26 19:39:28 -0800
commit6b2e7203ae5c90fb9fb1ef353fdc18372f36d11f (patch)
tree20b41ef19499ea904559f28969faafb6b77bc0ae
parentcf0977ad72e97ae7d2aad1f0b6a2fe1a0209bbe7 (diff)
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 <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Alan Somers <[email protected]> Closes #11528
-rw-r--r--lib/libuutil/uu_avl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libuutil/uu_avl.c b/lib/libuutil/uu_avl.c
index 040008883..53def0e07 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);