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:
parent
9b44277a73
commit
40316fa981
@ -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.
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user