diff options
author | jasone <jasone@FreeBSD.org> | 2000-05-16 21:57:12 +0000 |
---|---|---|
committer | jasone <jasone@FreeBSD.org> | 2000-05-16 21:57:12 +0000 |
commit | e3cda7421d1200af9960288af861554b935f0fcd (patch) | |
tree | 6dc30088a4d6c68e3ab38b6d7cd6306e60e44219 /lib/libpthread | |
parent | 898e24acb66c9d74fc15b81d6093e3567f6da6eb (diff) | |
download | FreeBSD-src-e3cda7421d1200af9960288af861554b935f0fcd.zip FreeBSD-src-e3cda7421d1200af9960288af861554b935f0fcd.tar.gz |
Fix a memory leak. pthread_set_name_np() allocates space for a name, but
_thread_gc() was not deallocating it.
PR: misc/18504
Diffstat (limited to 'lib/libpthread')
-rw-r--r-- | lib/libpthread/thread/thr_gc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libpthread/thread/thr_gc.c b/lib/libpthread/thread/thr_gc.c index a6ffd4b..cd1f838 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. |