kconfig: Fix expr_free() E_NOT leak
Ulf Magnusson authored
[ Upstream commit 5b1374b3

 ]

Only the E_NOT operand and not the E_NOT node itself was freed, due to
accidentally returning too early in expr_free(). Outline of leak:

	switch (e->type) {
	...
	case E_NOT:
		expr_free(e->left.expr);
		return;
	...
	}
	*Never reached, 'e' leaked*
	free(e);

Fix by changing the 'return' to a 'break'.

Summary from Valgrind on 'menuconfig' (ARCH=x86) before the fix:

	LEAK SUMMARY:
	   definitely lost: 44,448 bytes in 1,852 blocks
	   ...

Summary after the fix:

	LEAK SUMMARY:
	   definitely lost: 1,608 bytes in 67 blocks
	   ...
Signed-off-by: default avatarUlf Magnusson <ulfalizer@gmail.com>
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
81efefe2
Name Last commit Last update
..
basic kernel: build bin2c based on config option CONFIG_BUILD_BIN2C
coccinelle scripts/coccinelle: modernize &
dtc kbuild: trivial - remove trailing empty lines
genksyms genksyms: fix typeof() handling
kconfig kconfig: Fix expr_free() E_NOT leak
ksymoops Linux-2.6.12-rc2
mod modpost: don't emit section mismatch warnings for compiler optimizations
package Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
rt-tester kbuild: Make scripts executable
selinux kbuild: Make scripts executable
tracing kbuild: Make scripts executable
.gitignore bin2c: move bin2c in scripts/basic
Kbuild.include kbuild: simplify build, clean, modbuiltin shorthands
Lindent scripts/Lindent: support gnu indent v2.2.10
Makefile bin2c: move bin2c in scripts/basic
Makefile.asm-generic kbuild: trivial - remove trailing empty lines
Makefile.build kbuild: remove obj-n and lib-n handling
Makefile.clean kbuild: Fix removal of the debian/ directory
Makefile.extrawarn kbuild: move -Wunused-const-variable to W=1 warning level
Makefile.fwinst kbuild: remove obj-n and lib-n handling
Makefile.headersinst kbuild: fix make headers_install when path is too long
Makefile.help Add a target to use the Coccinelle checker
Makefile.host kbuild: handle the dependency of multi-objs hostprogs appropriately
Makefile.lib kbuild: handle multi-objs dependency appropriately
Makefile.modbuiltin kbuild: Create output directory in Makefile.modbuiltin
Makefile.modinst
Makefile.modpost
Makefile.modsign
analyze_suspend.py
asn1_compiler.c
bloat-o-meter
bootgraph.pl
checkincludes.pl
checkkconfigsymbols.sh
checkpatch.pl
checkstack.pl
checksyscalls.sh
checkversion.pl
cleanfile
cleanpatch
coccicheck
config
conmakehash.c
decode_stacktrace.sh
decodecode
depmod.sh
diffconfig
docproc.c
export_report.pl
extract-ikconfig
extract-vmlinux
gcc-goto.sh
gcc-ld
gcc-version.sh
gcc-x86_32-has-stack-protector.sh
gcc-x86_64-has-stack-protector.sh
gen_initramfs_list.sh
get_maintainer.pl
gfp-translate
headerdep.pl
headers.sh
headers_check.pl
headers_install.sh
kallsyms.c
kernel-doc
ld-version.sh
link-vmlinux.sh
makelst
markup_oops.pl
mkcompile_h
mkmakefile
mksysmap
mkuboot.sh
mkversion
module-common.lds
namespace.pl
objdiff
patch-kernel
pnmtologo.c
profile2linkerlist.pl
recordmcount.c
recordmcount.h
recordmcount.pl
setlocalversion
show_delta
sign-file
sortextable.c
sortextable.h
spelling.txt
tags.sh
unifdef.c
ver_linux
xz_wrap.sh