From 92fc0e0ff12eb2e1c311b7583be2d55d0dd67da3 Mon Sep 17 00:00:00 2001 From: "S.J.R. van Schaik" Date: Wed, 14 Jun 2017 13:21:49 +0200 Subject: [PATCH] shell: free the key in cmd_exec() --- source/shell/cmd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/shell/cmd.c b/source/shell/cmd.c index ddc95f7..36e11c8 100644 --- a/source/shell/cmd.c +++ b/source/shell/cmd.c @@ -72,9 +72,11 @@ void cmd_exec(struct cmd *cmds, const char *line) for (cmd = cmds; cmd->key; ++cmd) { if (strcmp(cmd->key, key) == 0) { cmd->exec(args); - return; + break; } } + + free(key); } void cmd_loop(const char *show)