mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
Prevent memory leak on sem_destroy() by destroying the semaphore's
internal mutex and CV.
This commit is contained in:
parent
21dbb6363b
commit
e3b4bf9411
1 changed files with 4 additions and 1 deletions
|
|
@ -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 a new issue