]> granicus.if.org Git - vim/commitdiff
patch 8.0.1064: Coverity warns for leaking resource v8.0.1064
authorBram Moolenaar <Bram@vim.org>
Tue, 5 Sep 2017 21:32:38 +0000 (23:32 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 5 Sep 2017 21:32:38 +0000 (23:32 +0200)
Problem:    Coverity warns for leaking resource.
Solution:   Free pty_master_fd on failure.

src/os_unix.c
src/version.c

index 57ea4d94516d65c8c0bf594b0362f6ca48187826..1ec59fcdcfa1602582c9b8fe0abc4b48de33a501 100644 (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;
 
index 6be7b825537a5e537756153df7bf617cd4e77b25..6a0fa7b611c30f9c38168a2b5504f0e162bbc664 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1064,
 /**/
     1063,
 /**/