[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250120185041.GA870489@pevik>
Date: Mon, 20 Jan 2025 19:50:41 +0100
From: Petr Vorel <petr.vorel@...il.com>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kconfig: fix memory leak in sym_warn_unmet_dep()
Hi Masahiro,
> The string allocated in sym_warn_unmet_dep() is never freed, leading
> to a memory leak when an unmet dependency is detected.
Reviewed-by: Petr Vorel <pvorel@...e.cz>
+1
I looked at other str_new() uses, but all looks to be using str_free()
(or return a pointer, which is freed by the caller).
Kind regards,
Petr
> Fixes: f8f69dc0b4e0 ("kconfig: make unmet dependency warnings readable")
> Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
> ---
> scripts/kconfig/symbol.c | 1 +
> 1 file changed, 1 insertion(+)
> diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
> index 89b84bf8e21f..1521cdf62fce 100644
> --- a/scripts/kconfig/symbol.c
> +++ b/scripts/kconfig/symbol.c
> @@ -389,6 +389,7 @@ static void sym_warn_unmet_dep(const struct symbol *sym)
> fputs(str_get(&gs), stderr);
> sym_warnings++;
> + str_free(&gs);
> }
> bool sym_dep_errors(void)
Powered by blists - more mailing lists