Prevent memory leak on sem_destroy() by destroying the semaphore's
internal mutex and CV.
This commit is contained in:
parent
21dbb6363b
commit
e3b4bf9411
@ -182,8 +182,11 @@ __sem_destroy(sem_t *sem)
|
||||
}
|
||||
_pthread_mutex_unlock(&(*sem)->lock);
|
||||
|
||||
if (retval == 0)
|
||||
if (retval == 0) {
|
||||
_pthread_mutex_destroy(&(*sem)->lock);
|
||||
_pthread_cond_destroy(&(*sem)->gtzero);
|
||||
sem_free(*sem);
|
||||
}
|
||||
return (retval);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user