mirror of
https://gitee.com/openharmony/third_party_f2fs-tools
synced 2024-11-26 19:51:32 +00:00
fsck.f2fs: fix memory leak caused by fsck_chk_orphan_node()
commit 15d4d7be94
category: bugfix
issue: #I6VAS0
CVE: NA
Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------
With invalid node info from fsck_chk_orphan_node(), orphan_blk
and new_blk are not freed. Fix memory leak in the path.
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
This commit is contained in:
parent
6277e2330f
commit
96a2b29742
@ -1780,8 +1780,11 @@ int fsck_chk_orphan_node(struct f2fs_sb_info *sbi)
|
||||
if (c.preen_mode == PREEN_MODE_1 && !c.fix_on) {
|
||||
get_node_info(sbi, ino, &ni);
|
||||
if (!IS_VALID_NID(sbi, ino) ||
|
||||
!IS_VALID_BLK_ADDR(sbi, ni.blk_addr))
|
||||
!IS_VALID_BLK_ADDR(sbi, ni.blk_addr)) {
|
||||
free(orphan_blk);
|
||||
free(new_blk);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user