changeset 12369:d7f087d1b0e5 v8.0.1064

patch 8.0.1064: Coverity warns for leaking resource commit https://github.com/vim/vim/commit/1b9f9d315f137cc883c7aecd39f3df329b7f9085 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Sep 5 23:32:38 2017 +0200 patch 8.0.1064: Coverity warns for leaking resource Problem: Coverity warns for leaking resource. Solution: Free pty_master_fd on failure.
author Christian Brabandt <cb@256bit.org>
date Tue, 05 Sep 2017 23:45:05 +0200
parents 4fe07a0c9b47
children 3ff706eb6066
files src/os_unix.c src/version.c
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -5692,7 +5692,10 @@ mch_create_pty_channel(job_T *job, jobop
 
     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;
 
--- a/src/version.c
+++ b/src/version.c
@@ -770,6 +770,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1064,
+/**/
     1063,
 /**/
     1062,