U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Quentin Schulz <quentin.schulz@cherry.de>
To: ant.v.moryakov@gmail.com, u-boot@lists.denx.de
Cc: Maks Mishin <maks.mishinFZ@gmail.com>
Subject: Re: [PATCH] tools: image-host: Fix potential memory leak
Date: Fri, 18 Apr 2025 15:52:18 +0200	[thread overview]
Message-ID: <30b1e59f-9a13-40ef-8b46-cae7c70f79bb@cherry.de> (raw)
In-Reply-To: <20250418083009.15859-1-ant.v.moryakov@gmail.com>

Hi,

On 4/18/25 10:30 AM, ant.v.moryakov@gmail.com wrote:
> From: Maks Mishin <maks.mishinFZ@gmail.com>
> 
> Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
> ---
>   tools/image-host.c | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/image-host.c b/tools/image-host.c
> index 4a24dee8..453cd38f 100644
> --- a/tools/image-host.c
> +++ b/tools/image-host.c
> @@ -1029,10 +1029,13 @@ static int fit_config_process_sig(const char *keydir, const char *keyfile,
>   				   &region_proplen))
>   		return -1;
>   
> -	if (fit_image_setup_sig(&info, keydir, keyfile, fit, conf_name, noffset,
> +	ret = fit_image_setup_sig(&info, keydir, keyfile, fit, conf_name, noffset,
>   				require_keys ? "conf" : NULL, engine_id,
> -				algo_name))
> +				algo_name);
> +	if (ret) {
> +		free(info.name);

Don't we need to free it all the time (i mean in the happy path even, 
after it's not useful anymore?)? When is it not useful anymore?

Please provide some information in the commit log as well, thanks!

Cheers,
Quentin

  reply	other threads:[~2025-04-18 13:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-18  8:30 [PATCH] tools: image-host: Fix potential memory leak ant.v.moryakov
2025-04-18 13:52 ` Quentin Schulz [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-04-18  8:32 ant.v.moryakov
2025-04-18  8:19 [PATCH] scripts: Fix potential null-deref ant.v.moryakov
2025-04-18  8:19 ` [PATCH] tools: image-host: Fix potential memory leak ant.v.moryakov
2025-04-18 13:52   ` Quentin Schulz

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=30b1e59f-9a13-40ef-8b46-cae7c70f79bb@cherry.de \
    --to=quentin.schulz@cherry.de \
    --cc=ant.v.moryakov@gmail.com \
    --cc=maks.mishinFZ@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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