0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 7.4.1625

Problem:    Trying to close file descriptor that isn't open.
Solution:   Check for negative number.
This commit is contained in:
Bram Moolenaar
2016-03-20 21:02:00 +01:00
parent 03602ec28e
commit be6aa46c4d
2 changed files with 5 additions and 3 deletions

View File

@@ -5214,11 +5214,11 @@ mch_start_job(char **argv, job_T *job, jobopt_T *options UNUSED)
job->jv_channel = channel; /* ch_refcount was set above */
/* child stdin, stdout and stderr */
if (!use_file_for_in)
if (!use_file_for_in && fd_in[0] >= 0)
close(fd_in[0]);
if (!use_file_for_out)
if (!use_file_for_out && fd_out[1] >= 0)
close(fd_out[1]);
if (!use_out_for_err && !use_file_for_err)
if (!use_out_for_err && !use_file_for_err && fd_err[1] >= 0)
close(fd_err[1]);
if (channel != NULL)
{