diff options
author | Jason Evans <jasone@FreeBSD.org> | 2000-05-16 21:57:12 +0000 |
---|---|---|
committer | Jason Evans <jasone@FreeBSD.org> | 2000-05-16 21:57:12 +0000 |
commit | 40316fa9812750f08462dd32cab884c0b331fc54 (patch) | |
tree | 67604707bb00f7adc4150db4b02ad01e1caa9790 /lib | |
parent | 9b44277a7325213a1d291aedfb886e1b7215e0d8 (diff) | |
download | src-40316fa9812750f08462dd32cab884c0b331fc54.tar.gz src-40316fa9812750f08462dd32cab884c0b331fc54.zip |
Fix a memory leak. pthread_set_name_np() allocates space for a name, but
_thread_gc() was not deallocating it.
PR: misc/18504
Notes
Notes:
svn path=/head/; revision=60656
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc_r/uthread/uthread_gc.c | 4 | ||||
-rw-r--r-- | lib/libpthread/thread/thr_gc.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/libc_r/uthread/uthread_gc.c b/lib/libc_r/uthread/uthread_gc.c index a6ffd4ba58d7..cd1f8383a33d 100644 --- a/lib/libc_r/uthread/uthread_gc.c +++ b/lib/libc_r/uthread/uthread_gc.c @@ -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. diff --git a/lib/libpthread/thread/thr_gc.c b/lib/libpthread/thread/thr_gc.c index a6ffd4ba58d7..cd1f8383a33d 100644 --- a/lib/libpthread/thread/thr_gc.c +++ b/lib/libpthread/thread/thr_gc.c @@ -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. |