summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2015-10-16 07:43:30 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2015-10-16 07:43:30 +0000
commit139345dc4e6ca9145834595e5c62676726f8e534 (patch)
tree2d3aaf06cc95eb66d3ac7ad649ece16041b0ccb3 /usr.bin/tmux
parent3fd8a6794a0c4763da6948c551f806354d2dc393 (diff)
Don't free after calling paste_set but do after evbuffer_add, from Theo
Buehler.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/cmd-capture-pane.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-capture-pane.c b/usr.bin/tmux/cmd-capture-pane.c
index 8b8e8f9aab0..378ed74f6e3 100644
--- a/usr.bin/tmux/cmd-capture-pane.c
+++ b/usr.bin/tmux/cmd-capture-pane.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-capture-pane.c,v 1.33 2015/10/07 09:52:58 nicm Exp $ */
+/* $OpenBSD: cmd-capture-pane.c,v 1.34 2015/10/16 07:43:29 nicm Exp $ */
/*
* Copyright (c) 2009 Jonathan Alvarado <radobobo@users.sourceforge.net>
@@ -200,11 +200,11 @@ cmd_capture_pane_exec(struct cmd *self, struct cmd_q *cmdq)
return (CMD_RETURN_ERROR);
}
evbuffer_add(c->stdout_data, buf, len);
+ free(buf);
if (args_has(args, 'P') && len > 0)
evbuffer_add(c->stdout_data, "\n", 1);
server_push_stdout(c);
} else {
-
bufname = NULL;
if (args_has(args, 'b'))
bufname = args_get(args, 'b');
@@ -217,6 +217,5 @@ cmd_capture_pane_exec(struct cmd *self, struct cmd_q *cmdq)
}
}
- free(buf);
return (CMD_RETURN_NORMAL);
}