Skip to content

Commit 9418216

Browse files
Wei Yongjunnamjaejeon
authored andcommitted
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: 5f2aa07 ("exfat: add inode operations") Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Namjae Jeon <[email protected]>
1 parent 0357794 commit 9418216

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/exfat/namei.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,7 @@ static int exfat_find(struct inode *dir, struct qstr *qname,
692692
exfat_fs_error(sb,
693693
"non-zero size file starts with zero cluster (size : %llu, p_dir : %u, entry : 0x%08x)",
694694
i_size_read(dir), ei->dir.dir, ei->entry);
695+
kfree(es);
695696
return -EIO;
696697
}
697698

0 commit comments

Comments
 (0)