ubifs: dent: Fix some potential memory leaks while iterating entries
commit58f6e78a65
upstream. Fix some potential memory leaks in error handling branches while iterating dent entries. For example, function dbg_check_dir() forgets to free pdent if it exists. Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com> Cc: <stable@vger.kernel.org> Fixes:1e51764a3c
("UBIFS: add new flash file system") Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
88401813fc
commit
b08433b1c5
@ -1129,6 +1129,7 @@ int dbg_check_dir(struct ubifs_info *c, const struct inode *dir)
|
|||||||
err = PTR_ERR(dent);
|
err = PTR_ERR(dent);
|
||||||
if (err == -ENOENT)
|
if (err == -ENOENT)
|
||||||
break;
|
break;
|
||||||
|
kfree(pdent);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user