summaryrefslogtreecommitdiffstats
path: root/cmd-capture-pane.c
diff options
context:
space:
mode:
authornicm <nicm>2015-10-16 07:43:29 +0000
committernicm <nicm>2015-10-16 07:43:29 +0000
commitcf89abb01367c9f0d7e848ef0058465e8eddf09c (patch)
tree65b4232176b62f5cbf3c2157712795c645d164b9 /cmd-capture-pane.c
parent241fd72f754388c140036eb1b826a07700f5be3b (diff)
Don't free after calling paste_set but do after evbuffer_add, from Theo
Buehler.
Diffstat (limited to 'cmd-capture-pane.c')
-rw-r--r--cmd-capture-pane.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/cmd-capture-pane.c b/cmd-capture-pane.c
index bd9ecebb..8958a12d 100644
--- a/cmd-capture-pane.c
+++ b/cmd-capture-pane.c
@@ -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);
}