Free thread name memory if there is.

This commit is contained in:
David Xu 2003-09-23 04:02:23 +00:00
parent 725bc17312
commit cc640f7aaa
2 changed files with 8 additions and 0 deletions

View File

@ -2352,6 +2352,10 @@ _thr_free(struct pthread *curthread, struct pthread *thread)
kse_critical_t crit;
DBG_MSG("Freeing thread %p\n", thread);
if (thread->name) {
free(thread->name);
thread->name = NULL;
}
if ((curthread == NULL) || (free_thread_count >= MAX_CACHED_THREADS)) {
thr_destroy(thread);
} else {

View File

@ -2352,6 +2352,10 @@ _thr_free(struct pthread *curthread, struct pthread *thread)
kse_critical_t crit;
DBG_MSG("Freeing thread %p\n", thread);
if (thread->name) {
free(thread->name);
thread->name = NULL;
}
if ((curthread == NULL) || (free_thread_count >= MAX_CACHED_THREADS)) {
thr_destroy(thread);
} else {