Skip to content

Commit

Permalink
kconfig: Don't leak choice names during parsing
Browse files Browse the repository at this point in the history
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 5a1aa8a ("kconfig: add named choice group").

Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Ulf Magnusson <[email protected]>
  • Loading branch information
masahir0y committed Mar 2, 2018
1 parent 1b1e4ee commit bf0bbdc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions scripts/kconfig/zconf.y
Original file line number Diff line number Diff line change
Expand Up @@ -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());
};

Expand Down

0 comments on commit bf0bbdc

Please sign in to comment.