From: Bram Moolenaar Date: Wed, 14 Jul 2010 14:59:57 +0000 (+0200) Subject: Fix using freed memory in :find completion. X-Git-Tag: v7.3~259 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b28ebbca8400dccfc5eb9957ed96fcba9fe05e46;p=vim Fix using freed memory in :find completion. --- diff --git a/src/misc1.c b/src/misc1.c index 675c2e77a..493b532bd 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -9550,15 +9550,14 @@ gen_expand_wildcards(num_pat, pat, num_file, file, flags) vim_free(t); } +#if defined(FEAT_SEARCHPATH) + if (flags & EW_PATH) + uniquefy_paths(&ga, p); +#endif if (p != pat[i]) vim_free(p); } -#if defined(FEAT_SEARCHPATH) - if (flags & EW_PATH) - uniquefy_paths(&ga, p); -#endif - *num_file = ga.ga_len; *file = (ga.ga_data != NULL) ? (char_u **)ga.ga_data : (char_u **)"";