diff options
author | dt <dt@FreeBSD.org> | 1999-08-30 15:45:42 +0000 |
---|---|---|
committer | dt <dt@FreeBSD.org> | 1999-08-30 15:45:42 +0000 |
commit | 0c0843ee5ccb3f63c49a7656ae2c80c28020726f (patch) | |
tree | ebbbcbd18e99bf1b48db2d0bbd1b07636f58e3c8 /lib/libpthread/thread/thr_exit.c | |
parent | 7b6ca448b139defb098de9a60816d7383e532293 (diff) | |
download | FreeBSD-src-0c0843ee5ccb3f63c49a7656ae2c80c28020726f.zip FreeBSD-src-0c0843ee5ccb3f63c49a7656ae2c80c28020726f.tar.gz |
Fix a memory leak: free the thread-specific poll_data, used in the select()
implementation.
PR: 13368
Submitted by: Steve Bernacki, Jr. <steve@copacetic.net>
Diffstat (limited to 'lib/libpthread/thread/thr_exit.c')
-rw-r--r-- | lib/libpthread/thread/thr_exit.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libpthread/thread/thr_exit.c b/lib/libpthread/thread/thr_exit.c index c989443..795decc 100644 --- a/lib/libpthread/thread/thr_exit.c +++ b/lib/libpthread/thread/thr_exit.c @@ -134,6 +134,12 @@ pthread_exit(void *status) _thread_cleanupspecific(); } + /* Free thread-specific poll_data structure, if allocated */ + if (_thread_run->poll_data.fds != NULL) { + free(_thread_run->poll_data.fds); + _thread_run->poll_data.fds = NULL; + } + /* * Defer signals to protect the scheduling queues from access * by the signal handler: |