diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-12-24 09:17:08 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-12-24 09:17:08 +0000 |
commit | 08b0f94e71b5ac73abc7def470f61d5c179332cd (patch) | |
tree | 43284ae8a442b55a09013d32e35a1b6bfd0b8fc6 /pjlib/src/pj/os_core_unix.c | |
parent | a925c96f932042fd00f1648b51c15bd2373e691d (diff) |
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
Diffstat (limited to 'pjlib/src/pj/os_core_unix.c')
-rw-r--r-- | pjlib/src/pj/os_core_unix.c | 7 |
1 files changed, 7 insertions, 0 deletions
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; |