eval.c: Fix memory leak for detached pty job

This commit is contained in:
oni-link 2016-09-02 01:57:49 +02:00
parent 1c9d7270a8
commit f8a8a56908

View File

@ -21765,6 +21765,9 @@ static inline bool common_job_start(TerminalJobData *data, typval_T *rettv)
Process *proc = (Process *)&data->proc;
if (proc->type == kProcessTypePty && proc->detach) {
EMSG2(_(e_invarg2), "terminal/pty job cannot be detached");
xfree(data->proc.pty.term_name);
shell_free_argv(proc->argv);
free_term_job_data_event((void **)&data);
return false;
}