To: vim_dev@googlegroups.com Subject: Patch 7.4.1966 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1966 Problem: Coverity reports a resource leak. Solution: Close "fd" also when bailing out. Files: src/quickfix.c *** ../vim-7.4.1965/src/quickfix.c 2016-06-26 22:05:50.325740235 +0200 --- src/quickfix.c 2016-06-28 21:09:28.397075890 +0200 *************** *** 1101,1107 **** } /* return number of matches */ retval = qi->qf_lists[qi->qf_curlist].qf_count; ! goto qf_init_ok; } EMSG(_(e_readerrf)); error2: --- 1101,1107 ---- } /* return number of matches */ retval = qi->qf_lists[qi->qf_curlist].qf_count; ! goto qf_init_end; } EMSG(_(e_readerrf)); error2: *************** *** 1109,1121 **** qi->qf_listcount--; if (qi->qf_curlist > 0) --qi->qf_curlist; ! qf_init_ok: 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); --- 1109,1120 ---- qi->qf_listcount--; if (qi->qf_curlist > 0) --qi->qf_curlist; ! 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); vim_free(namebuf); vim_free(errmsg); vim_free(pattern); *** ../vim-7.4.1965/src/version.c 2016-06-27 21:10:28.148544550 +0200 --- src/version.c 2016-06-28 21:10:12.760558844 +0200 *************** *** 755,756 **** --- 755,758 ---- { /* Add new patch number below this line */ + /**/ + 1966, /**/ -- hundred-and-one symptoms of being an internet addict: 160. You get in the elevator and double-click the button for the floor you want. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///