From f1552d07d715b437d941659479942c2543b02bd4 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 21 Aug 2019 12:54:18 +0200 Subject: patch 8.1.1897: may free memory twice when out of memory Problem: May free memory twice when out of memory. Solution: Check that backslash_halve_save() returns a different pointer. (Dominique Pelle, closes #4847) --- src/misc1.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/misc1.c') diff --git a/src/misc1.c b/src/misc1.c index 4884f6cb5..5f0a7b6c3 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -4086,7 +4086,9 @@ gen_expand_wildcards( addfile(&ga, t, flags | EW_DIR | EW_FILE); else addfile(&ga, t, flags); - vim_free(t); + + if (t != p) + vim_free(t); } #if defined(FEAT_SEARCHPATH) -- cgit v1.2.1