mirror of
https://github.com/tmate-io/tmate.git
synced 2026-08-03 16:12:08 +00:00
evbuffer_readline returns allocated storage, don't leak it.
This commit is contained in:
parent
f81d723264
commit
cb6f36655e
2 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
2
status.c
2
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue