diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-03-29 16:53:03 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-03-29 16:53:03 +0000 |
commit | 79749b135bef212fe96e7d17ade0bb65a14f8340 (patch) | |
tree | cf5597a209ebcc50b8c6f25bdde967d416b9eef4 /nuttx/lib | |
parent | 134f57877848076567f0f86c82075378d5ff92d4 (diff) | |
download | px4-nuttx-79749b135bef212fe96e7d17ade0bb65a14f8340.tar.gz px4-nuttx-79749b135bef212fe96e7d17ade0bb65a14f8340.tar.bz2 px4-nuttx-79749b135bef212fe96e7d17ade0bb65a14f8340.zip |
Container being deallocated before buffers in container. Caused memory leak.
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@177 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/lib')
-rw-r--r-- | nuttx/lib/lib_init.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/nuttx/lib/lib_init.c b/nuttx/lib/lib_init.c index 0e820ff4c..8bf872c55 100644 --- a/nuttx/lib/lib_init.c +++ b/nuttx/lib/lib_init.c @@ -173,9 +173,9 @@ void lib_releaselist(FAR struct streamlist *list) /* Destroy the semaphore and release the filelist */ (void)sem_destroy(&list->sl_sem); - sched_free(list); - /* Initialize each FILE structure */ + /* Release each stream in the list */ + #if CONFIG_STDIO_BUFFER_SIZE > 0 for (i = 0; i < CONFIG_NFILE_STREAMS; i++) { @@ -190,6 +190,9 @@ void lib_releaselist(FAR struct streamlist *list) } } #endif + /* Finally, release the list itself */ + + sched_free(list); } } } |