evbuffer_readline returns allocated storage, don't leak it.

pull/1/head
Nicholas Marriott 2013-03-22 15:55:22 +00:00
parent 2243cfbe75
commit c519f9a84c
3 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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--;