mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-08 01:04:06 +01:00
Couple of memory leaks in error paths, from Frederik Vanderstraeten.
This commit is contained in:
parent
695a591f8e
commit
7340d5adfd
@ -196,6 +196,7 @@ cmd_capture_pane_exec(struct cmd *self, struct cmd_q *cmdq)
|
||||
if (c == NULL ||
|
||||
(c->session != NULL && !(c->flags & CLIENT_CONTROL))) {
|
||||
cmdq_error(cmdq, "can't write to stdout");
|
||||
free(buf);
|
||||
return (CMD_RETURN_ERROR);
|
||||
}
|
||||
evbuffer_add(c->stdout_data, buf, len);
|
||||
@ -210,11 +211,12 @@ cmd_capture_pane_exec(struct cmd *self, struct cmd_q *cmdq)
|
||||
|
||||
if (paste_set(buf, len, bufname, &cause) != 0) {
|
||||
cmdq_error(cmdq, "%s", cause);
|
||||
free(buf);
|
||||
free(cause);
|
||||
free(buf);
|
||||
return (CMD_RETURN_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
free(buf);
|
||||
return (CMD_RETURN_NORMAL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user