exfat: fix possible memory leak in exfat_find()
Subsystems (3)
PATCH 1/1 exfat: fix possible memory leak in exfat_find()
'es' is malloced from exfat_get_dentry_set() in exfat_find() and should be freed before leaving from the error handling cases, otherwise it will cause memory leak.
Fixes 5f2aa075070c ("exfat: add inode operations")
Signed-off-by Wei Yongjun <[email protected]>
--- fs/exfat/namei.c | 1 + 1 file changed, 1 insertion(+)
fs/exfat/namei.c +1 -0
@@ -681,6 +681,7 @@ static int exfat_find(struct inode *dir, struct qstr *qname,exfat_fs_error (sb,"non-zero size file starts with zero cluster (size : %llu, p_dir : %u, entry : 0x%08x)" ,i_size_read (dir), ei->dir.dir, ei->entry); +kfree (es);return -EIO ; }
Namjae Jeon
AppliedQuoted 5 lines
'es' is malloced from
exfat_get_dentry_set()inexfat_find()and should be freed before leaving from the error handling cases, otherwise it will cause memory leak.Fixes 5f2aa075070c ("exfat: add inode operations")Signed-off-by Wei Yongjun <[email protected]>
Applied.
Thanks!
Quoted 17 lines
--- fs/exfat/namei.c | 1 + 1 file changed, 1 insertion(+)fs/exfat/namei.c +1
-0@@ -681,6 +681,7 @@ static int exfat_find(struct inode *dir, struct qstr *qname,exfat_fs_error (sb, "non-zero size file starts with zero cluster (size : %llu, p_dir : %u, entry : 0x%08x)", i_size_read(dir), ei->dir.dir, ei->entry); +kfree (es);return -EIO ; }