mirror of
https://gitee.com/openharmony/third_party_f2fs-tools
synced 2024-11-26 19:51:32 +00:00
dump.f2fs: fix memory leak caused by dump_node_blk()
Fix to free node_blk when nid is 0 from dump_node_blk(). 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>
This commit is contained in:
parent
15d4d7be94
commit
19d49b51bd
@ -278,7 +278,7 @@ static void dump_node_blk(struct f2fs_sb_info *sbi, int ntype,
|
||||
|
||||
if (nid == 0) {
|
||||
*ofs += skip;
|
||||
return;
|
||||
goto out;
|
||||
}
|
||||
|
||||
for (i = 0; i < idx; i++, (*ofs)++) {
|
||||
@ -297,6 +297,7 @@ static void dump_node_blk(struct f2fs_sb_info *sbi, int ntype,
|
||||
break;
|
||||
}
|
||||
}
|
||||
out:
|
||||
free(node_blk);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user