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>
This commit is contained in:
dt 1999-08-30 15:45:42 +00:00
parent 7b6ca448b1
commit 0c0843ee5c
3 changed files with 18 additions and 0 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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: