Prevent memory leak on sem_destroy() by destroying the semaphore's

internal mutex and CV.
This commit is contained in:
Daniel Eischen 2004-02-06 15:15:44 +00:00
parent 21dbb6363b
commit e3b4bf9411

View File

@ -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);
}