mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 19:25:11 -07:00
vim-patch:8.0.0707: freeing wrong memory with certain autocommands
Problem: Freeing wrong memory when manipulating buffers in autocommands.
(James McCoy)
Solution: Also set the w_s pointer if w_buffer was NULL.
f1d13478e3
This commit is contained in:
parent
fee4e39ca3
commit
b79523681d
@ -2352,8 +2352,8 @@ int do_ecmd(
|
||||
} else {
|
||||
// <VN> We could instead free the synblock
|
||||
// and re-attach to buffer, perhaps.
|
||||
if (curwin->w_buffer != NULL
|
||||
&& curwin->w_s == &(curwin->w_buffer->b_s)) {
|
||||
if (curwin->w_buffer == NULL
|
||||
|| curwin->w_s == &(curwin->w_buffer->b_s)) {
|
||||
curwin->w_s = &(buf->b_s);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user