vim-patch:8.1.1897: may free memory twice when out of memory (#10827)

Problem:    May free memory twice when out of memory.
Solution:   Check that backslash_halve_save() returns a different pointer.
            (Dominique Pelle, closes vim/vim#4847)
f1552d07d7
This commit is contained in:
Jan Edmund Lazo
2019-08-22 00:49:33 -04:00
committed by Daniel Hahler
parent bb50eadc84
commit ed28668392
4 changed files with 21 additions and 16 deletions

View File

@@ -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))