]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Mutex: fix leak of pthread_mutexattr 4760/head
authorKetor Meng <d.ketor@gmail.com>
Tue, 26 May 2015 10:50:17 +0000 (18:50 +0800)
committerKetor Meng <d.ketor@gmail.com>
Tue, 26 May 2015 14:41:03 +0000 (22:41 +0800)
Need pthread_mutexattr_destroy after pthread_mutexattr_init

Fixes: #111762
Signed-off-by: Ketor Meng <d.ketor@gmail.com>
src/common/Mutex.cc

index 40850e46e1dabd85b137888de534b4f8e092577a..173829457564af4f2bf95695507ed3c078e147d9 100644 (file)
@@ -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();
   }