summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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) {