Patch 8.2.4625

8 views
Skip to first unread message

Bram Moolenaar

unread,
Mar 25, 2022, 10:54:52 AM3/25/22
to vim...@googlegroups.com

Patch 8.2.4625
Problem: Old Coverity warning for resource leak.
Solution: Call FreeWild() if expanding matches did not fail.
Files: src/help.c


*** ../vim-8.2.4624/src/help.c 2022-01-31 14:59:33.518943700 +0000
--- src/help.c 2022-03-25 14:52:47.152717397 +0000
***************
*** 947,952 ****
--- 947,953 ----
FILE *fd_tags;
FILE *fd;
garray_T ga;
+ int res;
int filecount;
char_u **files;
char_u *p1, *p2;
***************
*** 965,976 ****
STRCPY(NameBuff, dir);
STRCAT(NameBuff, "/**/*");
STRCAT(NameBuff, ext);
! if (gen_expand_wildcards(1, &NameBuff, &filecount, &files,
! EW_FILE|EW_SILENT) == FAIL
! || filecount == 0)
{
if (!got_int)
semsg(_(e_no_match_str_1), NameBuff);
return;
}

--- 966,979 ----
STRCPY(NameBuff, dir);
STRCAT(NameBuff, "/**/*");
STRCAT(NameBuff, ext);
! res = gen_expand_wildcards(1, &NameBuff, &filecount, &files,
! EW_FILE|EW_SILENT);
! if (res == FAIL || filecount == 0)
{
if (!got_int)
semsg(_(e_no_match_str_1), NameBuff);
+ if (res != FAIL)
+ FreeWild(filecount, files);
return;
}

*** ../vim-8.2.4624/src/version.c 2022-03-25 14:46:43.957805290 +0000
--- src/version.c 2022-03-25 14:53:27.440604071 +0000
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 4625,
/**/

--
`When any government, or any church for that matter, undertakes to say to
its subjects, "This you may not read, this you must not see, this you are
forbidden to know," the end result is tyranny and oppression no matter how
holy the motives' -- Robert A Heinlein, "If this goes on --"

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages