summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/format.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2019-03-29 09:33:25 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2019-03-29 09:33:25 +0000
commit721bf35892cb740f6306c7f6c75c2871f094394b (patch)
treefed18c49f52c748ff4c3bfb0c74ae34ae3540d29 /usr.bin/tmux/format.c
parent6b41af9e52bedbc3a8b82027517972e0062e2abf (diff)
Free old strings after they have been expanded in format_choose.
Diffstat (limited to 'usr.bin/tmux/format.c')
-rw-r--r--usr.bin/tmux/format.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c
index b92b36fcee0..91d48c4bf35 100644
--- a/usr.bin/tmux/format.c
+++ b/usr.bin/tmux/format.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: format.c,v 1.187 2019/03/28 21:05:15 nicm Exp $ */
+/* $OpenBSD: format.c,v 1.188 2019/03/29 09:33:24 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1025,7 +1025,9 @@ format_choose(struct format_tree *ft, const char *s, char **left, char **right,
if (expand) {
*left = format_expand(ft, left0);
+ free(left0);
*right = format_expand(ft, right0);
+ free(right0);
} else {
*left = left0;
*right = right0;