Files
android_kernel_xiaomi_sm8450/scripts/kconfig
Ulf Magnusson 0724a7c32a kconfig: Don't leak main menus during parsing
If a 'mainmenu' entry appeared in the Kconfig files, two things would
leak:

	- The 'struct property' allocated for the default "Linux Kernel
	  Configuration" prompt.

	- The string for the T_WORD/T_WORD_QUOTE prompt after the
	  T_MAINMENU token, allocated on the heap in zconf.l.

To fix it, introduce a new 'no_mainmenu_stmt' nonterminal that matches
if there's no 'mainmenu' and adds the default prompt. That means the
prompt only gets allocated once regardless of whether there's a
'mainmenu' statement or not, and managing it becomes simple.

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

	LEAK SUMMARY:
	   definitely lost: 344,568 bytes in 14,352 blocks
	   ...

Summary after the fix:

	LEAK SUMMARY:
	   definitely lost: 344,440 bytes in 14,350 blocks
	   ...

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-01-22 00:49:23 +09:00
..
2017-08-19 11:02:53 -07:00
2015-10-20 19:13:14 +02:00
2017-12-07 23:46:57 +09:00
2005-04-16 15:20:36 -07:00
2017-08-19 11:02:53 -07:00
2017-08-19 11:02:53 -07:00
2015-10-14 14:59:03 +02:00
2015-02-25 15:00:16 +01:00