summaryrefslogtreecommitdiff
path: root/src/misc1.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-08-21 12:54:18 +0200
committerBram Moolenaar <Bram@vim.org>2019-08-21 12:54:18 +0200
commitf1552d07d715b437d941659479942c2543b02bd4 (patch)
tree75f97a65490a0d0ac259eea2eda3c7ae2d2109a0 /src/misc1.c
parenteaf35241197fc6b9ee9af993095bf5e6f35c8f1a (diff)
downloadvim-git-f1552d07d715b437d941659479942c2543b02bd4.tar.gz
patch 8.1.1897: may free memory twice when out of memoryv8.1.1897
Problem: May free memory twice when out of memory. Solution: Check that backslash_halve_save() returns a different pointer. (Dominique Pelle, closes #4847)
Diffstat (limited to 'src/misc1.c')
-rw-r--r--src/misc1.c4
1 files changed, 3 insertions, 1 deletions
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)