summaryrefslogtreecommitdiffstats
path: root/commands/menu.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-11-23 09:41:33 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-01-10 08:27:33 +0100
commitc757c676428d70d854c3c7c637b8b7e7a8697043 (patch)
tree47e95747bfba6ad73e240230ea72309a2d85c6df /commands/menu.c
parent9fe05e5ebc13f215d96957ca18e00b71c0d926a4 (diff)
downloadbarebox-c757c676428d70d854c3c7c637b8b7e7a8697043.tar.gz
menu: sanitize menu_add_title
passing a string to menu_add_title() which then gets free by this function is just plain ugly. Pass it a const char * which gets duplicated in menu_add_title() when necessary. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/menu.c')
-rw-r--r--commands/menu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commands/menu.c b/commands/menu.c
index 72db26e..ddc9c3a 100644
--- a/commands/menu.c
+++ b/commands/menu.c
@@ -147,7 +147,7 @@ static int do_menu_add(struct cmd_menu *cm)
if (!m->name)
goto free;
- menu_add_title(m, strdup(cm->description));
+ menu_add_title(m, cm->description);
ret = menu_add(m);