From: "Darrick J. Wong" <djwong@kernel.org>
To: Wu Guanghao <wuguanghao3@huawei.com>
Cc: tytso@mit.edu, adilger.kernel@dilger.ca,
linux-ext4@vger.kernel.org, yangyun50@huawei.com
Subject: Re: [PATCH 1/2] fsck: fix memory leak of inst->type
Date: Tue, 18 Nov 2025 10:30:21 -0800 [thread overview]
Message-ID: <20251118183021.GQ196358@frogsfrogsfrogs> (raw)
In-Reply-To: <20251118132601.2756185-2-wuguanghao3@huawei.com>
On Tue, Nov 18, 2025 at 09:26:00PM +0800, Wu Guanghao wrote:
> The function free_instance() does not release i->type, resulting in a
> memory leak.
Does anyone still use this wrapper? I thought everyone used the
/sbin/fsck from util-linux...
--D
> Signed-off-by: Wu Guanghao <wuguanghao3@huawei.com>
> ---
> misc/fsck.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/misc/fsck.c b/misc/fsck.c
> index 64d0e7c0..a06f2668 100644
> --- a/misc/fsck.c
> +++ b/misc/fsck.c
> @@ -235,6 +235,7 @@ static void parse_escape(char *word)
> static void free_instance(struct fsck_instance *i)
> {
> free(i->prog);
> + free(i->type);
> free(i->device);
> free(i->base_device);
> free(i);
> --
> 2.27.0
>
>
next prev parent reply other threads:[~2025-11-18 18:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-18 13:25 [PATCH 0/2] e2fsprogs: fix memory leaks detected by ASAN Wu Guanghao
2025-11-18 13:26 ` [PATCH 1/2] fsck: fix memory leak of inst->type Wu Guanghao
2025-11-18 18:30 ` Darrick J. Wong [this message]
2025-11-19 1:25 ` Wu Guanghao
2025-11-19 6:32 ` Darrick J. Wong
2025-11-18 13:26 ` [PATCH 2/2] resize: fix memory leak when exiting normally Wu Guanghao
2025-11-18 18:29 ` Darrick J. Wong
2025-11-19 1:52 ` Wu Guanghao
2025-11-19 6:26 ` Darrick J. Wong
2025-11-20 3:45 ` Wu Guanghao
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=20251118183021.GQ196358@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=adilger.kernel@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
--cc=wuguanghao3@huawei.com \
--cc=yangyun50@huawei.com \
/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