Mercurial > vim
changeset 9369:ce5b79b005ec v7.4.1966
commit https://github.com/vim/vim/commit/bcf7772a23624edc0942120e564f6b4ac95604ad
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jun 28 21:11:32 2016 +0200
patch 7.4.1966
Problem: Coverity reports a resource leak.
Solution: Close "fd" also when bailing out.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 28 Jun 2016 21:15:06 +0200 |
parents | 94b6a7494bb1 |
children | be73bb923c55 |
files | src/quickfix.c src/version.c |
diffstat | 2 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/quickfix.c +++ b/src/quickfix.c @@ -1101,7 +1101,7 @@ restofline: } /* return number of matches */ retval = qi->qf_lists[qi->qf_curlist].qf_count; - goto qf_init_ok; + goto qf_init_end; } EMSG(_(e_readerrf)); error2: @@ -1109,13 +1109,12 @@ error2: qi->qf_listcount--; if (qi->qf_curlist > 0) --qi->qf_curlist; -qf_init_ok: +qf_init_end: if (fd != NULL) fclose(fd); free_efm_list(&fmt_first); qf_clean_dir_stack(&dir_stack); qf_clean_dir_stack(&file_stack); -qf_init_end: vim_free(namebuf); vim_free(errmsg); vim_free(pattern);