summaryrefslogtreecommitdiff
path: root/src/helper/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/helper/command.c')
-rw-r--r--src/helper/command.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/helper/command.c b/src/helper/command.c
index 2737a7b2..d93020e9 100644
--- a/src/helper/command.c
+++ b/src/helper/command.c
@@ -117,6 +117,10 @@ static int script_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
words[i] = strdup(w);
if (words[i] == NULL)
{
+ int j;
+ for (j = 0; j < i; j++)
+ free(words[j]);
+ free(words);
return JIM_ERR;
}
}