Commit c7bca03b authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Wentao Guan
Browse files

kconfig: fix memory leak in sym_warn_unmet_dep()

stable inclusion
from stable-v6.6.76
commit 29f5ee6c9774eccd75583d40b3c9c12c72ef54fc
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IBW08Q

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=29f5ee6c9774eccd75583d40b3c9c12c72ef54fc



--------------------------------

[ Upstream commit a409fc1463d664002ea9bf700ae4674df03de111 ]

The string allocated in sym_warn_unmet_dep() is never freed, leading
to a memory leak when an unmet dependency is detected.

Fixes: f8f69dc0 ("kconfig: make unmet dependency warnings readable")
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
Reviewed-by: default avatarPetr Vorel <pvorel@suse.cz>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
(cherry picked from commit 29f5ee6c9774eccd75583d40b3c9c12c72ef54fc)
Signed-off-by: default avatarWentao Guan <guanwentao@uniontech.com>
parent a28d39c7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -321,6 +321,7 @@ static void sym_warn_unmet_dep(struct symbol *sym)
			       "  Selected by [m]:\n");

	fputs(str_get(&gs), stderr);
	str_free(&gs);
	sym_warnings++;
}