diff options
author | davidxu <davidxu@FreeBSD.org> | 2003-09-23 04:02:23 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2003-09-23 04:02:23 +0000 |
commit | 0414766399840f87486055798dc24ef28705b182 (patch) | |
tree | f8ae686cbdc69e72d501f08ccff269b3e62a1caa | |
parent | 32e8aa5d886eb1acd710d59d96c6c29d8436b527 (diff) | |
download | FreeBSD-src-0414766399840f87486055798dc24ef28705b182.zip FreeBSD-src-0414766399840f87486055798dc24ef28705b182.tar.gz |
Free thread name memory if there is.
-rw-r--r-- | lib/libkse/thread/thr_kern.c | 4 | ||||
-rw-r--r-- | lib/libpthread/thread/thr_kern.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/libkse/thread/thr_kern.c b/lib/libkse/thread/thr_kern.c index bf94a11..b8a48de 100644 --- a/lib/libkse/thread/thr_kern.c +++ b/lib/libkse/thread/thr_kern.c @@ -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 { diff --git a/lib/libpthread/thread/thr_kern.c b/lib/libpthread/thread/thr_kern.c index bf94a11..b8a48de 100644 --- a/lib/libpthread/thread/thr_kern.c +++ b/lib/libpthread/thread/thr_kern.c @@ -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 { |