(empth_exit, empth_rwlock_destroy): Plug memory leaks.
This commit is contained in:
parent
d0ab92b944
commit
3db0e2eb15
1 changed files with 5 additions and 1 deletions
|
@ -264,9 +264,12 @@ empth_self(void)
|
|||
void
|
||||
empth_exit(void)
|
||||
{
|
||||
empth_t *ctx = pthread_getspecific(ctx_key);
|
||||
|
||||
empth_status("empth_exit");
|
||||
pthread_mutex_unlock(&mtx_ctxsw);
|
||||
free(pthread_getspecific(ctx_key));
|
||||
free(ctx->name);
|
||||
free(ctx);
|
||||
pthread_exit(0);
|
||||
}
|
||||
|
||||
|
@ -479,6 +482,7 @@ void
|
|||
empth_rwlock_destroy(empth_rwlock_t *rwlock)
|
||||
{
|
||||
pthread_rwlock_destroy(&rwlock->lock);
|
||||
free(rwlock->name);
|
||||
free(rwlock);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue