summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2010-08-21 19:05:52 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2010-08-30 21:02:57 +0200
commitc0477d8233369aed15a48239886ffa679802c48a (patch)
tree15ae3b431370ecc08e910305b21ee06eb0961857
parentf50d2063cbcd4a5ebd474445f9d9395918d342a1 (diff)
downloadbarebox-c0477d8233369aed15a48239886ffa679802c48a.tar.gz
menu: do not go to free if there's nothing to free
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--commands/menu.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/commands/menu.c b/commands/menu.c
index b874ccb..f3bd78d 100644
--- a/commands/menu.c
+++ b/commands/menu.c
@@ -80,9 +80,8 @@ static int do_menu_entry_add(struct cmd_menu *cm)
}
me = menu_entry_alloc();
-
if (!me)
- goto free;
+ return -ENOMEM;
if (cm->submenu) {
me->action = menu_action_show;