mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
vim-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.
90da27b927
This commit is contained in:
@@ -5580,12 +5580,15 @@ static void helptags_one(char *dir, const char *ext, const char *tagfname, bool
|
||||
// Note: We cannot just do `&NameBuff` because it is a statically sized array
|
||||
// so `NameBuff == &NameBuff` according to C semantics.
|
||||
char *buff_list[1] = { (char *)NameBuff };
|
||||
if (gen_expand_wildcards(1, (char_u **)buff_list, &filecount, (char_u ***)&files,
|
||||
EW_FILE|EW_SILENT) == FAIL
|
||||
|| filecount == 0) {
|
||||
const int res = gen_expand_wildcards(1, (char_u **)buff_list, &filecount, (char_u ***)&files,
|
||||
EW_FILE|EW_SILENT);
|
||||
if (res == FAIL || filecount == 0) {
|
||||
if (!got_int) {
|
||||
semsg(_("E151: No match: %s"), NameBuff);
|
||||
}
|
||||
if (res != FAIL) {
|
||||
FreeWild(filecount, (char_u **)files);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user