From: Seung-Woo Kim <sw0312.kim@samsung.com>
To: jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org, chao@kernel.org, sw0312.kim@samsung.com
Subject: [RESEND][PATCH 1/2] resize.f2fs: fix memory leak caused by migrate_nat()
Date: Fri, 7 May 2021 20:12:23 +0900 [thread overview]
Message-ID: <20210507111224.29887-1-sw0312.kim@samsung.com> (raw)
In-Reply-To: CGME20210507110917epcas1p13e027d5e0319629c255524c8c6f6461b@epcas1p1.samsung.com
Alloced nat_block doesn't freed from migrate_nat(). Fix to free
nat_block.
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
---
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
next parent reply other threads:[~2021-05-07 11:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20210507110917epcas1p13e027d5e0319629c255524c8c6f6461b@epcas1p1.samsung.com>
2021-05-07 11:12 ` Seung-Woo Kim [this message]
[not found] ` <CGME20210507110917epcas1p4a2d7ebd7e2fd8cc630fdf627ad73a003@epcas1p4.samsung.com>
2021-05-07 11:12 ` [RESEND][PATCH 2/2] mkfs.f2fs: fix memory leak in not enough segments error path Seung-Woo Kim
2021-05-08 6:31 ` [f2fs-dev] " Chao Yu
2021-05-08 6:30 ` [f2fs-dev] [RESEND][PATCH 1/2] resize.f2fs: fix memory leak caused by migrate_nat() Chao Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210507111224.29887-1-sw0312.kim@samsung.com \
--to=sw0312.kim@samsung.com \
--cc=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).