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(); channel = add_channel();
if (channel == NULL) if (channel == NULL)
{
close(pty_master_fd);
return FAIL; return FAIL;
}
job->jv_channel = channel; /* ch_refcount was set by add_channel() */ job->jv_channel = channel; /* ch_refcount was set by add_channel() */
channel->ch_keep_open = TRUE; channel->ch_keep_open = TRUE;

View File

@@ -769,6 +769,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1064,
/**/ /**/
1063, 1063,
/**/ /**/