summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2018-02-20 14:40:29 +0300
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-03-02 03:20:55 +0300
commitbf0bbdcf1003220b7ca9a6aa00a84e27e94287e8 (patch)
treeae194f2149d33917adea2a335ca19cbcb093848b /scripts
parent1b1e4ee86e0064ea2a8b8e5ead13734b1e813a92 (diff)
downloadlinux-bf0bbdcf1003220b7ca9a6aa00a84e27e94287e8.tar.xz
kconfig: Don't leak choice names during parsing
The named choice is not used in the kernel tree, but if it were used, it would not be freed. The intention of the named choice can be seen in the log of commit 5a1aa8a1aff6 ("kconfig: add named choice group"). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/zconf.y1
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index f5cb55f03ce5..ad6305b0f40c 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -276,6 +276,7 @@ choice: T_CHOICE word_opt T_EOL
sym->flags |= SYMBOL_AUTO;
menu_add_entry(sym);
menu_add_expr(P_CHOICE, NULL, NULL);
+ free($2);
printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
};