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:
Seung-Woo Kim 2021-05-10 17:57:26 +09:00 committed by Jaegeuk Kim
parent 15d4d7be94
commit 19d49b51bd

View File

@ -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);
}