summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2013-03-22 15:55:22 +0000
committerNicholas Marriott <nicm@openbsd.org>2013-03-22 15:55:22 +0000
commitc519f9a84cd9fc3fdec8b61afaf42995f9e48b46 (patch)
treed919d29ab80617b5f44f43952bfe3cf6b6dc1542
parent2243cfbe7559e6cf48194ff95dcd7eb6df5fe41d (diff)
evbuffer_readline returns allocated storage, don't leak it.
-rw-r--r--cmd-break-pane.c1
-rw-r--r--cmd-run-shell.c1
-rw-r--r--status.c4
3 files changed, 3 insertions, 3 deletions
diff --git a/cmd-break-pane.c b/cmd-break-pane.c
index 038ec85c..57628a7a 100644
--- a/cmd-break-pane.c
+++ b/cmd-break-pane.c
@@ -93,7 +93,6 @@ cmd_break_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
server_status_session_group(s);
if (args_has(args, 'P')) {
-
if ((template = args_get(args, 'F')) == NULL)
template = BREAK_PANE_TEMPLATE;
diff --git a/cmd-run-shell.c b/cmd-run-shell.c
index ea7d1dcb..0d19a8e6 100644
--- a/cmd-run-shell.c
+++ b/cmd-run-shell.c
@@ -112,6 +112,7 @@ cmd_run_shell_callback(struct job *job)
do {
if ((line = evbuffer_readline(job->event->input)) != NULL) {
cmd_run_shell_print (job, line);
+ free(line);
lines++;
}
} while (line != NULL);
diff --git a/status.c b/status.c
index 0bee54e9..fc773dca 100644
--- a/status.c
+++ b/status.c
@@ -676,7 +676,7 @@ status_job_callback(struct job *job)
memcpy(buf, EVBUFFER_DATA(job->event->input), len);
buf[len] = '\0';
} else
- buf = xstrdup(line);
+ buf = line;
so->out = buf;
server_status_client(c);
@@ -1042,7 +1042,7 @@ status_prompt_key(struct client *c, int key)
size_t size, n, off, idx;
size = strlen(c->prompt_buffer);
- switch (mode_key_lookup(&c->prompt_mdata, key)) {
+ switch (mode_key_lookup(&c->prompt_mdata, key, NULL)) {
case MODEKEYEDIT_CURSORLEFT:
if (c->prompt_index > 0) {
c->prompt_index--;