public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Wu Guanghao <wuguanghao3@huawei.com>
Cc: tytso@mit.edu, linux-ext4@vger.kernel.org,
	adilger.kernel@dilger.ca, yangyun50@huawei.com
Subject: Re: [PATCH v2 1/2] fsck: fix memory leak of inst->type
Date: Fri, 21 Nov 2025 08:23:01 -0800	[thread overview]
Message-ID: <20251121162301.GT196358@frogsfrogsfrogs> (raw)
In-Reply-To: <20251121033612.2423536-2-wuguanghao3@huawei.com>

On Fri, Nov 21, 2025 at 11:36:11AM +0800, Wu Guanghao wrote:
> The function free_instance() does not release i->type, resulting in a
> memory leak.
> 
> Signed-off-by: Wu Guanghao <wuguanghao3@huawei.com>

Looks good!
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  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
> 
> 

  reply	other threads:[~2025-11-21 16:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-21  3:36 [PATCH v2 0/2] e2fsprogs: fix memory leaks detected by ASAN Wu Guanghao
2025-11-21  3:36 ` [PATCH v2 1/2] fsck: fix memory leak of inst->type Wu Guanghao
2025-11-21 16:23   ` Darrick J. Wong [this message]
2025-11-21  3:36 ` [PATCH v2 2/2] resize: fix memory leak when exiting normally Wu Guanghao
2026-03-05 17:38   ` Theodore Tso

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=20251121162301.GT196358@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