Mercurial > vim
comparison src/misc1.c @ 17801:6582dda76821 v8.1.1897
patch 8.1.1897: may free memory twice when out of memory
commit https://github.com/vim/vim/commit/f1552d07d715b437d941659479942c2543b02bd4
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Aug 21 12:54:18 2019 +0200
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 21 Aug 2019 13:00:03 +0200 |
parents | 0f7ae8010787 |
children | 46f95606b9ec |
comparison
equal
deleted
inserted
replaced
17800:ecad47058bfc | 17801:6582dda76821 |
---|---|
4084 * "vim c:/" work. */ | 4084 * "vim c:/" work. */ |
4085 if (flags & EW_NOTFOUND) | 4085 if (flags & EW_NOTFOUND) |
4086 addfile(&ga, t, flags | EW_DIR | EW_FILE); | 4086 addfile(&ga, t, flags | EW_DIR | EW_FILE); |
4087 else | 4087 else |
4088 addfile(&ga, t, flags); | 4088 addfile(&ga, t, flags); |
4089 vim_free(t); | 4089 |
4090 if (t != p) | |
4091 vim_free(t); | |
4090 } | 4092 } |
4091 | 4093 |
4092 #if defined(FEAT_SEARCHPATH) | 4094 #if defined(FEAT_SEARCHPATH) |
4093 if (did_expand_in_path && ga.ga_len > 0 && (flags & EW_PATH)) | 4095 if (did_expand_in_path && ga.ga_len > 0 && (flags & EW_PATH)) |
4094 uniquefy_paths(&ga, p); | 4096 uniquefy_paths(&ga, p); |