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:
fe2d5c8
)
Fix potential memory leakage
author
TaeJun Kwon
<tj80.kwon@samsung.com>
Mon, 3 Apr 2017 08:30:17 +0000
(17:30 +0900)
committer
TaeJun Kwon
<tj80.kwon@samsung.com>
Mon, 3 Apr 2017 08:30:17 +0000
(17:30 +0900)
There are potential memory leakage in rmdir & unlink in smartfs
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
a42686c
..
49c7d9e
100644
(file)
--- a/
os/fs/smartfs/smartfs_smart.c
+++ b/
os/fs/smartfs/smartfs_smart.c
@@
-1680,6
+1680,9
@@
static int smartfs_unlink(struct inode *mountpt, const char *relpath)
ret = OK;
errout_with_semaphore:
+ if (entry.name != NULL) {
+ kmm_free(entry.name);
+ }
smartfs_semgive(fs);
return ret;
}
@@
-1862,6
+1865,9
@@
int smartfs_rmdir(struct inode *mountpt, const char *relpath)
ret = OK;
errout_with_semaphore:
+ if (entry.name != NULL) {
+ kmm_free(entry.name);
+ }
smartfs_semgive(fs);
return ret;
}