diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-03-25 14:54:18 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-03-25 14:54:18 +0000 |
commit | 90da27b9277d74521202e5c146a09056696898ee (patch) | |
tree | 464ced85b7cf97d8cb5e414f268c9565f7ee438e /src | |
parent | 5d46dcfeed4fcbbab371e17e1072b0cc9abe5217 (diff) |
patch 8.2.4625: old Coverity warning for resource leakv8.2.4625
Problem: Old Coverity warning for resource leak.
Solution: Call FreeWild() if expanding matches did not fail.
Diffstat (limited to 'src')
-rw-r--r-- | src/help.c | 9 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/help.c b/src/help.c index 661d5b5c3c..48178fda3b 100644 --- a/src/help.c +++ b/src/help.c @@ -947,6 +947,7 @@ helptags_one( FILE *fd_tags; FILE *fd; garray_T ga; + int res; int filecount; char_u **files; char_u *p1, *p2; @@ -965,12 +966,14 @@ helptags_one( STRCPY(NameBuff, dir); STRCAT(NameBuff, "/**/*"); STRCAT(NameBuff, ext); - if (gen_expand_wildcards(1, &NameBuff, &filecount, &files, - EW_FILE|EW_SILENT) == FAIL - || filecount == 0) + 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; } diff --git a/src/version.c b/src/version.c index 4a20c4665e..748a12f398 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4625, +/**/ 4624, /**/ 4623, |