From 0c0843ee5ccb3f63c49a7656ae2c80c28020726f Mon Sep 17 00:00:00 2001
From: dt
Date: Mon, 30 Aug 1999 15:45:42 +0000
Subject: Fix a memory leak: free the thread-specific poll_data, used in the
select() implementation.
PR: 13368
Submitted by: Steve Bernacki, Jr.
---
lib/libpthread/thread/thr_exit.c | 6 ++++++
1 file changed, 6 insertions(+)
(limited to 'lib/libpthread/thread/thr_exit.c')
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:
--
cgit v1.1