From: Junling Zheng <zhengjunling@huawei.com>
To: linux-f2fs-devel@lists.sourceforge.net
Subject: [PATCH 1/4] fsck.f2fs: free cp_page_1 in validate_checkpoint
Date: Thu, 29 Sep 2016 18:38:34 +0800 [thread overview]
Message-ID: <1475145517-18366-1-git-send-email-zhengjunling@huawei.com> (raw)
Free cp_page_1 in validate_checkpoint to avoid memory leak.
Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
---
fsck/mount.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fsck/mount.c b/fsck/mount.c
index 3be60bb..e390b26 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -494,7 +494,7 @@ void *validate_checkpoint(struct f2fs_sb_info *sbi, block_t cp_addr,
/* Read the 1st cp block in this CP pack */
cp_page_1 = malloc(PAGE_SIZE);
if (dev_read_block(cp_page_1, cp_addr) < 0)
- return NULL;
+ goto invalid_cp1;
cp = (struct f2fs_checkpoint *)cp_page_1;
crc_offset = get_cp(checksum_offset);
--
2.7.4
------------------------------------------------------------------------------
next reply other threads:[~2016-09-29 10:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-29 10:38 Junling Zheng [this message]
2016-09-29 10:38 ` [PATCH 2/4] fsck.f2fs: fix incorrect ERR_MSG in f2fs_do_mount Junling Zheng
2016-09-29 10:38 ` [PATCH 3/4] fsck.f2fs: fix a typo in check_sector_size Junling Zheng
2016-09-29 10:38 ` [PATCH 4/4] f2fs: unify the length of versions Junling Zheng
2016-09-30 16:25 ` Jaegeuk Kim
2016-10-08 1:08 ` Junling Zheng
2016-10-10 16:49 ` Jaegeuk Kim
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=1475145517-18366-1-git-send-email-zhengjunling@huawei.com \
--to=zhengjunling@huawei.com \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/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).