1
0
forked from aniani/vim

patch 8.0.1064: Coverity warns for leaking resource

Problem:    Coverity warns for leaking resource.
Solution:   Free pty_master_fd on failure.
This commit is contained in:
Bram Moolenaar
2017-09-05 23:32:38 +02:00
parent 28550b74bb
commit 1b9f9d315f
2 changed files with 5 additions and 0 deletions

View File

@@ -5692,7 +5692,10 @@ mch_create_pty_channel(job_T *job, jobopt_T *options)
channel = add_channel();
if (channel == NULL)
{
close(pty_master_fd);
return FAIL;
}
job->jv_channel = channel; /* ch_refcount was set by add_channel() */
channel->ch_keep_open = TRUE;