diff options
Diffstat (limited to 'src/nvim/path.c')
-rw-r--r-- | src/nvim/path.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c index a58d57d566..1c787e3a1d 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -1262,7 +1262,10 @@ int gen_expand_wildcards(int num_pat, char_u **pat, int *num_file, } else { addfile(&ga, t, flags); } - xfree(t); + + if (t != p) { + xfree(t); + } } if (did_expand_in_path && !GA_EMPTY(&ga) && (flags & EW_PATH)) |