From: TaeJun Kwon Date: Mon, 3 Apr 2017 08:30:17 +0000 (+0900) Subject: Fix potential memory leakage X-Git-Tag: 1.1_Public_Release~633^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3165535f41ea9c879a983b6e80fda0152712b602;p=rtos%2Ftinyara.git Fix potential memory leakage There are potential memory leakage in rmdir & unlink in smartfs --- diff --git a/os/fs/smartfs/smartfs_smart.c b/os/fs/smartfs/smartfs_smart.c index a42686c..49c7d9e 100644 --- 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; }