Fix a memory leak. pthread_set_name_np() allocates space for a name, but

_thread_gc() was not deallocating it.

PR:	misc/18504
This commit is contained in:
Jason Evans 2000-05-16 21:57:12 +00:00
parent 9b44277a73
commit 40316fa981
2 changed files with 8 additions and 0 deletions

View File

@ -242,6 +242,10 @@ _thread_gc(pthread_addr_t arg)
if (p_stack != NULL)
free(p_stack);
if (pthread_cln != NULL)
if (pthread_cln->name != NULL) {
/* Free the thread name string. */
free(pthread_cln->name);
}
/*
* Free the memory allocated for the thread
* structure.

View File

@ -242,6 +242,10 @@ _thread_gc(pthread_addr_t arg)
if (p_stack != NULL)
free(p_stack);
if (pthread_cln != NULL)
if (pthread_cln->name != NULL) {
/* Free the thread name string. */
free(pthread_cln->name);
}
/*
* Free the memory allocated for the thread
* structure.