0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 7.4.1966

Problem:    Coverity reports a resource leak.
Solution:   Close "fd" also when bailing out.
This commit is contained in:
Bram Moolenaar
2016-06-28 21:11:32 +02:00
parent adb78a77eb
commit bcf7772a23
2 changed files with 4 additions and 3 deletions

View File

@@ -1101,7 +1101,7 @@ restofline:
} }
/* return number of matches */ /* return number of matches */
retval = qi->qf_lists[qi->qf_curlist].qf_count; retval = qi->qf_lists[qi->qf_curlist].qf_count;
goto qf_init_ok; goto qf_init_end;
} }
EMSG(_(e_readerrf)); EMSG(_(e_readerrf));
error2: error2:
@@ -1109,13 +1109,12 @@ error2:
qi->qf_listcount--; qi->qf_listcount--;
if (qi->qf_curlist > 0) if (qi->qf_curlist > 0)
--qi->qf_curlist; --qi->qf_curlist;
qf_init_ok: qf_init_end:
if (fd != NULL) if (fd != NULL)
fclose(fd); fclose(fd);
free_efm_list(&fmt_first); free_efm_list(&fmt_first);
qf_clean_dir_stack(&dir_stack); qf_clean_dir_stack(&dir_stack);
qf_clean_dir_stack(&file_stack); qf_clean_dir_stack(&file_stack);
qf_init_end:
vim_free(namebuf); vim_free(namebuf);
vim_free(errmsg); vim_free(errmsg);
vim_free(pattern); vim_free(pattern);

View File

@@ -753,6 +753,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 */
/**/
1966,
/**/ /**/
1965, 1965,
/**/ /**/