From: Ketor Meng Date: Tue, 26 May 2015 10:50:17 +0000 (+0800) Subject: Mutex: fix leak of pthread_mutexattr X-Git-Tag: v0.80.11~47^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c6f37807d04af66fbed24e75776aed1b44241150;p=ceph.git 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) --- diff --git a/src/common/Mutex.cc b/src/common/Mutex.cc index f1e9a550c81..de666553571 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(); }