summaryrefslogtreecommitdiff
path: root/nuttx/sched
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-23 16:06:22 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-23 16:06:22 +0000
commitfb18a14fa419ea6627fa1f148bd1a479cd53639b (patch)
tree5fdfe02f401872922d56c1fadf93019edd45f3b7 /nuttx/sched
parentf4a63abc585084602a4af8f70367178e8c511337 (diff)
downloadpx4-nuttx-fb18a14fa419ea6627fa1f148bd1a479cd53639b.tar.gz
px4-nuttx-fb18a14fa419ea6627fa1f148bd1a479cd53639b.tar.bz2
px4-nuttx-fb18a14fa419ea6627fa1f148bd1a479cd53639b.zip
Fix memory leaks
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@133 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched')
-rw-r--r--nuttx/sched/pthread_join.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/nuttx/sched/pthread_join.c b/nuttx/sched/pthread_join.c
index 2754a35fe..3819c1fa3 100644
--- a/nuttx/sched/pthread_join.c
+++ b/nuttx/sched/pthread_join.c
@@ -195,6 +195,10 @@ int pthread_join(pthread_t thread, pthread_addr_t *pexit_value)
dbg("exit_value=0x%p\n", pjoin->exit_value);
}
+ /* Then remove the thread entry. */
+
+ (void)pthread_removejoininfo((pid_t)thread);
+
/* Post the thread's join semaphore so that exitting thread
* will know that we have received the data.
*/
@@ -205,6 +209,9 @@ int pthread_join(pthread_t thread, pthread_addr_t *pexit_value)
sched_unlock();
+ /* Deallocate the thread entry */
+
+ sched_free(pjoin);
ret = OK;
}