diff options
Diffstat (limited to 'src/filepath.c')
-rw-r--r-- | src/filepath.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/filepath.c b/src/filepath.c index 6644e9939..a1e281b0e 100644 --- a/src/filepath.c +++ b/src/filepath.c @@ -3813,8 +3813,13 @@ gen_expand_wildcards( vim_free(p); } + // When returning FAIL the array must be freed here. + if (retval == FAIL) + ga_clear(&ga); + *num_file = ga.ga_len; - *file = (ga.ga_data != NULL) ? (char_u **)ga.ga_data : (char_u **)""; + *file = (ga.ga_data != NULL) ? (char_u **)ga.ga_data + : (char_u **)_("no matches"); recursive = FALSE; |