summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2013-03-25 10:02:43 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2013-03-25 10:02:43 +0000
commit44d299778ee7b0bca26424339e14f1e084d4bf74 (patch)
tree491c617667372c9a239d4ffac525fb51a484555d /usr.bin
parent4656545e788b6d0cbfb669142c2eb5915b20340f (diff)
Plug small memory leak in run-shell. Don't potentially leak the command
to run were it to fail.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/cmd-run-shell.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/tmux/cmd-run-shell.c b/usr.bin/tmux/cmd-run-shell.c
index d32f4684c06..76e4681d468 100644
--- a/usr.bin/tmux/cmd-run-shell.c
+++ b/usr.bin/tmux/cmd-run-shell.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-run-shell.c,v 1.18 2013/03/24 09:54:10 nicm Exp $ */
+/* $OpenBSD: cmd-run-shell.c,v 1.19 2013/03/25 10:02:42 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -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);