vim-patch:7.4.1966

Problem:    Coverity reports a resource leak.
Solution:   Close "fd" also when bailing out.

bcf7772a23
This commit is contained in:
James McCoy
2016-12-12 15:05:58 -05:00
parent 82f54c0a5e
commit fd94e6313b
2 changed files with 3 additions and 4 deletions

View File

@@ -941,7 +941,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:
@@ -949,13 +949,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:
xfree(namebuf); xfree(namebuf);
xfree(errmsg); xfree(errmsg);
xfree(pattern); xfree(pattern);

View File

@@ -474,7 +474,7 @@ static int included_patches[] = {
// 1969 NA // 1969 NA
// 1968, // 1968,
1967, 1967,
// 1966, 1966,
// 1965 NA // 1965 NA
1964, 1964,
// 1963 NA // 1963 NA