From 08b0f94e71b5ac73abc7def470f61d5c179332cd Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Wed, 24 Dec 2008 09:17:08 +0000 Subject: Ticket #688: Memory leak on Solaris 10 with pjlib's mutex (thanks Andrey Kobtsev for the fix) git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2395 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib/src/pj/os_core_unix.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pjlib/src/pj/os_core_unix.c b/pjlib/src/pj/os_core_unix.c index ad6a86c4..f256ded9 100644 --- a/pjlib/src/pj/os_core_unix.c +++ b/pjlib/src/pj/os_core_unix.c @@ -1088,6 +1088,13 @@ static pj_status_t init_mutex(pj_mutex_t *mutex, const char *name, int type) return PJ_RETURN_OS_ERROR(rc); } + rc = pthread_mutexattr_destroy(&attr); + if (rc != 0) { + pj_status_t status = PJ_RETURN_OS_ERROR(rc); + pthread_mutex_destroy(&mutex->mutex); + return status; + } + #if PJ_DEBUG /* Set owner. */ mutex->nesting_level = 0; -- cgit v1.2.3