[PATCH 1/2] resize.f2fs: fix memory leak caused by migrate_nat()

From: Seung-Woo Kim
Date: Fri May 07 2021 - 07:00:46 EST


Alloced nat_block doesn't freed from migrate_nat(). Fix to free
nat_block.

Signed-off-by: Seung-Woo Kim <sw0312.kim@xxxxxxxxxxx>
---
fsck/resize.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/fsck/resize.c b/fsck/resize.c
index b043cd984dc6..78d578ec2cc1 100644
--- a/fsck/resize.c
+++ b/fsck/resize.c
@@ -383,6 +383,7 @@ static void migrate_nat(struct f2fs_sb_info *sbi,
ASSERT(ret >= 0);
DBG(3, "Write NAT: %lx\n", block_addr);
}
+ free(nat_block);
DBG(0, "Info: Done to migrate NAT blocks: nat_blkaddr = 0x%x -> 0x%x\n",
old_nat_blkaddr, new_nat_blkaddr);
}
--
2.19.2