diff options
Diffstat (limited to 'lib/libkse/thread/thr_mutex.c')
-rw-r--r-- | lib/libkse/thread/thr_mutex.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libkse/thread/thr_mutex.c b/lib/libkse/thread/thr_mutex.c index 2df59ef..8d0d76c 100644 --- a/lib/libkse/thread/thr_mutex.c +++ b/lib/libkse/thread/thr_mutex.c @@ -187,6 +187,8 @@ _pthread_mutex_init(pthread_mutex_t *mutex, MUTEX_INIT_LINK(pmutex); *mutex = pmutex; } else { + /* Free the mutex lock structure: */ + _lock_destroy(&pmutex->m_lock); free(pmutex); *mutex = NULL; } @@ -235,6 +237,10 @@ _pthread_mutex_destroy(pthread_mutex_t *mutex) * structure: */ MUTEX_ASSERT_NOT_OWNED(m); + + /* Free the mutex lock structure: */ + _lock_destroy(&m->m_lock); + free(m); } } |