kconfig: Don't leak 'option' arguments during parsing
authorUlf Magnusson <ulfalizer@gmail.com>
Sun, 8 Oct 2017 17:11:20 +0000 (19:11 +0200)
committerChristian Lamparter <chunkeey@gmail.com>
Sun, 10 Feb 2019 20:46:31 +0000 (21:46 +0100)
commitabe137d30a33eea202364fc452787bbe1b9abe38
tree3d2c428cfe2e68427a3589354fcc2b80bd02b48e
parent42bc2cb9fd5367ea805f291c72c81e67fbcabde5
kconfig: Don't leak 'option' arguments during parsing

The following strings would leak before this change:

- option env="LEAKED"
- option defconfig_list="LEAKED"

These come in the form of T_WORD tokens and are always allocated on the
heap in zconf.l. Free them.

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

LEAK SUMMARY:
   definitely lost: 344,616 bytes in 14,355 blocks
   ...

Summary after the fix:

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

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
config/zconf.y