Skip to content

Commit 90da27b

Browse files
committed
patch 8.2.4625: old Coverity warning for resource leak
Problem: Old Coverity warning for resource leak. Solution: Call FreeWild() if expanding matches did not fail.
1 parent 5d46dcf commit 90da27b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/help.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,7 @@ helptags_one(
947947
FILE *fd_tags;
948948
FILE *fd;
949949
garray_T ga;
950+
int res;
950951
int filecount;
951952
char_u **files;
952953
char_u *p1, *p2;
@@ -965,12 +966,14 @@ helptags_one(
965966
STRCPY(NameBuff, dir);
966967
STRCAT(NameBuff, "/**/*");
967968
STRCAT(NameBuff, ext);
968-
if (gen_expand_wildcards(1, &NameBuff, &filecount, &files,
969-
EW_FILE|EW_SILENT) == FAIL
970-
|| filecount == 0)
969+
res = gen_expand_wildcards(1, &NameBuff, &filecount, &files,
970+
EW_FILE|EW_SILENT);
971+
if (res == FAIL || filecount == 0)
971972
{
972973
if (!got_int)
973974
semsg(_(e_no_match_str_1), NameBuff);
975+
if (res != FAIL)
976+
FreeWild(filecount, files);
974977
return;
975978
}
976979

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
4625,
753755
/**/
754756
4624,
755757
/**/

0 commit comments

Comments
 (0)