android_kernel_samsung_univ.../scripts/kconfig
Ulf Magnusson 5bfe39f17d kconfig: Fix expr_free() E_NOT leak
[ Upstream commit 5b1374b3b3c2fc4f63a398adfa446fb8eff791a4 ]

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: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-30 07:48:53 +02:00
..
lxdialog
.gitignore
check.sh
conf.c
confdata.c
expr.c kconfig: Fix expr_free() E_NOT leak 2018-05-30 07:48:53 +02:00
expr.h
gconf.c
gconf.glade
images.c
kxgettext.c
list.h
lkc_proto.h
lkc.h
Makefile
mconf.c
menu.c kconfig: Fix automatic menu creation mem leak 2018-05-30 07:48:53 +02:00
merge_config.sh
nconf.c
nconf.gui.c kconfig/nconf: Fix hang when editing symbol with a long prompt 2017-01-09 08:07:53 +01:00
nconf.h
POTFILES.in
qconf.cc
qconf.h
streamline_config.pl
symbol.c
util.c
zconf.gperf
zconf.hash.c_shipped
zconf.l
zconf.lex.c_shipped
zconf.tab.c_shipped
zconf.y kconfig: Don't leak main menus during parsing 2018-05-30 07:48:53 +02:00