diff options
author | Bram Moolenaar <Bram@vim.org> | 2014-04-06 20:45:43 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2014-04-06 20:45:43 +0200 |
commit | 4c7ab1bb5722de662db04550b74256671f20c4a2 (patch) | |
tree | 9fc51404bf8d87a9aa99df7ff30f18617f03513b /src/fileio.c | |
parent | 75b8156a445fb4788dc3d1946764af30b5c50ac4 (diff) | |
download | vim-git-4c7ab1bb5722de662db04550b74256671f20c4a2.tar.gz |
updated for version 7.4.251v7.4.251
Problem: Crash when BufAdd autocommand wipes out the buffer.
Solution: Check for buffer to still be valid. Postpone freeing the buffer
structure. (Hirohito Higashi)
Diffstat (limited to 'src/fileio.c')
-rw-r--r-- | src/fileio.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/fileio.c b/src/fileio.c index 17f36e7b0..f8b384b9e 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -9548,13 +9548,19 @@ apply_autocmds_group(event, fname, fname_io, force, group, buf, eap) /* * When stopping to execute autocommands, restore the search patterns and - * the redo buffer. + * the redo buffer. Free buffers in the au_pending_free_buf list. */ if (!autocmd_busy) { restore_search_patterns(); restoreRedobuff(); did_filetype = FALSE; + while (au_pending_free_buf != NULL) + { + buf_T *b = au_pending_free_buf->b_next; + vim_free(au_pending_free_buf); + au_pending_free_buf = b; + } } /* |