From 2b74b6805b5c8c4836b66df5d949f5ff6a77f8c7 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Sun, 3 Apr 2022 21:30:32 +0100 Subject: patch 8.2.4679: cannot have expandcmd() give an error message for mistakes Problem: Cannot have expandcmd() give an error message for mistakes. Solution: Add an optional argument to give errors. Fix memory leak when expanding files fails. (Yegappan Lakshmanan, closes #10071) --- src/filepath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/filepath.c') diff --git a/src/filepath.c b/src/filepath.c index 5bf31ea8e8..3786ef6330 100644 --- a/src/filepath.c +++ b/src/filepath.c @@ -3999,7 +3999,7 @@ gen_expand_wildcards( // When returning FAIL the array must be freed here. if (retval == FAIL) - ga_clear(&ga); + ga_clear_strings(&ga); *num_file = ga.ga_len; *file = (ga.ga_data != NULL) ? (char_u **)ga.ga_data -- cgit v1.2.3