diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-06-25 11:40:04 -0400 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-06-25 11:41:45 -0400 |
commit | b79523681d2b7cf7e1c1f0b9174aa3804e1d5811 (patch) | |
tree | 4da0f7814d8ae94d830f71db35a836a92767a8f2 | |
parent | fee4e39ca3fd8e3f5292f05f33cb9a213f318176 (diff) | |
download | rneovim-b79523681d2b7cf7e1c1f0b9174aa3804e1d5811.tar.gz rneovim-b79523681d2b7cf7e1c1f0b9174aa3804e1d5811.tar.bz2 rneovim-b79523681d2b7cf7e1c1f0b9174aa3804e1d5811.zip |
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.
https://github.com/vim/vim/commit/f1d13478e3a7e1a86d52552c8c5571f00dc28ad1
-rw-r--r-- | src/nvim/ex_cmds.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index dbf11514cf..15b49b69ce 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -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); } |