projects
/
rtos
/
tinyara.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1fde63c
)
Fix memory leak when CONFIG_SMARTFS_USE_SECTOR_BUFFER is enabled
author
pradeep.ns
<pradeep.ns@samsung.com>
Mon, 4 Sep 2017 17:47:40 +0000
(23:17 +0530)
committer
pradeep.ns
<pradeep.ns@samsung.com>
Mon, 4 Sep 2017 17:58:36 +0000
(23:28 +0530)
During error case in smartfs_open() , sf->buffer is not freed.
Signed-off-by: pradeep.ns <pradeep.ns@samsung.com>
os/fs/smartfs/smartfs_smart.c
patch
|
blob
|
history
diff --git
a/os/fs/smartfs/smartfs_smart.c
b/os/fs/smartfs/smartfs_smart.c
index
f84926c
..
70c483c
100644
(file)
--- a/
os/fs/smartfs/smartfs_smart.c
+++ b/
os/fs/smartfs/smartfs_smart.c
@@
-345,6
+345,12
@@
static int smartfs_open(FAR struct file *filep, const char *relpath, int oflags,
goto errout_with_semaphore;
errout_with_buffer:
+#ifdef CONFIG_SMARTFS_USE_SECTOR_BUFFER
+ if (sf->buffer != NULL) {
+ kmm_free(sf->buffer);
+ sf->buffer = NULL;
+ }
+#endif
if (sf->entry.name != NULL) {
/* Free the space for the name too */