From 451bc33d020047388c036c57bfe7a90615370ce9 Mon Sep 17 00:00:00 2001 From: nicm Date: Sun, 4 Jun 2017 15:36:33 +0000 Subject: [PATCH] Do not leak command, from David CARLIER. --- usr.bin/tmux/mode-tree.c | 6 ++++-- 1 file 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 @@ -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) { -- 2.20.1