aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-07-27 12:27:42 +0800
committerGitHub <noreply@github.com>2022-07-27 12:27:42 +0800
commit57ce6c2b8ff1dc3045f6e6be325d3e6b6b4fb15c (patch)
treefbac53f3cf77c586bea562addb6f4d7deb759808 /src/nvim/ex_cmds.c
parent79872f377019614467a8e03049fb47c067331804 (diff)
parentbbad7371dbf83ec41931d1f506408dce4ef4e9b8 (diff)
downloadrneovim-57ce6c2b8ff1dc3045f6e6be325d3e6b6b4fb15c.tar.gz
rneovim-57ce6c2b8ff1dc3045f6e6be325d3e6b6b4fb15c.tar.bz2
rneovim-57ce6c2b8ff1dc3045f6e6be325d3e6b6b4fb15c.zip
Merge pull request #19531 from zeertzjq/vim-8.2.4623
vim-patch:8.2.{4623,4625}: coverity warnings
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r--src/nvim/ex_cmds.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index ea0fa31183..c65d9359ac 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -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;
}