aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeung-Woo Kim <sw0312.kim@samsung.com>2021-05-10 17:57:26 +0900
committerJaegeuk Kim <jaegeuk@kernel.org>2021-05-10 22:10:40 -0700
commit19d49b51bdf2f1235e19152edde6bbc9d94ced30 (patch)
treedb9c0bae51a24482a8049e117be1b8b211471b38
parent15d4d7be9457aa3a30e1b44c9ae452614cf14a6a (diff)
downloadf2fs-tools-19d49b51bdf2f1235e19152edde6bbc9d94ced30.tar.gz
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>
-rw-r--r--fsck/dump.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fsck/dump.c b/fsck/dump.c
index 055ce09..042a2e5 100644
--- a/fsck/dump.c
+++ b/fsck/dump.c
@@ -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);
}