summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/mode-tree.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2017-06-04 15:36:34 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2017-06-04 15:36:34 +0000
commit01b74bd97d8b621c180b6175b0ba34a9a046a0a1 (patch)
tree9d96c17453099540aefa0bfb0167faa0e77cb8a2 /usr.bin/tmux/mode-tree.c
parent15907406c9a9a4c2b5e48d05196845a79ce29cee (diff)
Do not leak command, from David CARLIER.
Diffstat (limited to 'usr.bin/tmux/mode-tree.c')
-rw-r--r--usr.bin/tmux/mode-tree.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/tmux/mode-tree.c b/usr.bin/tmux/mode-tree.c
index b6e3b6b839f..dbd4d3627a9 100644
--- a/usr.bin/tmux/mode-tree.c
+++ b/usr.bin/tmux/mode-tree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mode-tree.c,v 1.1 2017/05/30 21:44:59 nicm Exp $ */
+/* $OpenBSD: mode-tree.c,v 1.2 2017/06/04 15:36:33 nicm Exp $ */
/*
* Copyright (c) 2017 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -685,8 +685,10 @@ mode_tree_run_command(struct client *c, struct cmd_find_state *fs,
char *command, *cause;
command = cmd_template_replace(template, name, 1);
- if (command == NULL || *command == '\0')
+ if (command == NULL || *command == '\0') {
+ free(command);
return;
+ }
cmdlist = cmd_string_parse(command, NULL, 0, &cause);
if (cmdlist == NULL) {