mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2026-01-28 09:19:35 +00:00
Prior to this fix, zconf.y did not free symbol names from zconf.l in
these contexts:
- After T_CONFIG ('config LEAKED')
- After T_MENUCONFIG ('menuconfig LEAKED')
- After T_SELECT ('select LEAKED')
- After T_IMPLY ('imply LEAKED')
- After T_DEFAULT in a choice ('default LEAKED')
All of these come in the form of T_WORD tokens, which always have their
associated string allocated on the heap in zconf.l and need to be freed.
Fix by introducing a new nonterminal 'nonconst_symbol' which takes a
T_WORD, fetches the symbol, and then frees the T_WORD string. The
already existing 'symbol' nonterminal works the same way but also
accepts T_WORD_QUOTE, corresponding to a constant symbol. T_WORD_QUOTE
should not be accepted in any of the contexts above, so the 'symbol'
nonterminal can't be reused here.
Fetching the symbol in 'nonconst_symbol' also removes a bunch of
sym_lookup() calls from actions.
Summary from Valgrind on 'menuconfig' (ARCH=x86) before the fix:
LEAK SUMMARY:
definitely lost: 711,571 bytes in 37,756 blocks
...
Summary after the fix:
LEAK SUMMARY:
definitely lost: 387,504 bytes in 15,545 blocks
...
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
|
||
|---|---|---|
| .. | ||
| lxdialog | ||
| .gitignore | ||
| check.sh | ||
| conf.c | ||
| confdata.c | ||
| expr.c | ||
| expr.h | ||
| gconf.c | ||
| gconf.glade | ||
| images.c | ||
| kconf_id.c | ||
| kxgettext.c | ||
| list.h | ||
| lkc_proto.h | ||
| lkc.h | ||
| Makefile | ||
| mconf.c | ||
| menu.c | ||
| merge_config.sh | ||
| nconf.c | ||
| nconf.gui.c | ||
| nconf.h | ||
| POTFILES.in | ||
| qconf.cc | ||
| qconf.h | ||
| streamline_config.pl | ||
| symbol.c | ||
| util.c | ||
| zconf.l | ||
| zconf.y | ||