From c6f37807d04af66fbed24e75776aed1b44241150 Mon Sep 17 00:00:00 2001 From: Ketor Meng Date: Tue, 26 May 2015 18:50:17 +0800 Subject: [PATCH] Mutex: fix leak of pthread_mutexattr Need pthread_mutexattr_destroy after pthread_mutexattr_init Fixes: #111762 Signed-off-by: Ketor Meng (cherry picked from commit 2b23327b3aa8d96341d501a5555195ca1bc0de8f) --- src/common/Mutex.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/Mutex.cc b/src/common/Mutex.cc index f1e9a550c81b9..de6665535718e 100644 --- a/src/common/Mutex.cc +++ b/src/common/Mutex.cc @@ -55,6 +55,7 @@ Mutex::Mutex(const char *n, bool r, bool ld, pthread_mutexattr_init(&attr); pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK); pthread_mutex_init(&_m, &attr); + pthread_mutexattr_destroy(&attr); if (g_lockdep) _register(); } -- 2.39.5