1
0
forked from aniani/vim

updated for version 7.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)
This commit is contained in:
Bram Moolenaar
2014-04-06 20:45:43 +02:00
parent 75b8156a44
commit 4c7ab1bb57
5 changed files with 39 additions and 2 deletions

View File

@@ -3343,6 +3343,12 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
#endif
buf = buflist_new(ffname, sfname, 0L,
BLN_CURBUF | ((flags & ECMD_SET_HELP) ? 0 : BLN_LISTED));
#ifdef FEAT_AUTOCMD
/* autocommands may change curwin and curbuf */
if (oldwin != NULL)
oldwin = curwin;
old_curbuf = curbuf;
#endif
}
if (buf == NULL)
goto theend;