summaryrefslogtreecommitdiffstats
path: root/cmd-run-shell.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2013-02-25 07:33:21 +0000
committerThomas Adam <thomas@xteddy.org>2013-02-25 07:33:21 +0000
commit2ccb67cae4eafa0f86d95317186719d1bfd09d57 (patch)
treee219e4a303ff8bae5e0953346a68f5025c17958e /cmd-run-shell.c
parentb2a61348ddd2dbe91c6b656ef7ddd64a535e0b20 (diff)
Plug small memory leak in run-shell
Don't potentially leak the command to run were it to fail.
Diffstat (limited to 'cmd-run-shell.c')
-rw-r--r--cmd-run-shell.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/cmd-run-shell.c b/cmd-run-shell.c
index aaa310b9..f805c7ae 100644
--- a/cmd-run-shell.c
+++ b/cmd-run-shell.c
@@ -101,6 +101,7 @@ cmd_run_shell_exec(struct cmd *self, struct cmd_q *cmdq)
cmdq->references++;
job_run(shellcmd, cmd_run_shell_callback, cmd_run_shell_free, cdata);
+ free(shellcmd);
if (cdata->bflag)
return (CMD_RETURN_NORMAL);