To: vim_dev@googlegroups.com Subject: Patch 8.0.0707 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0707 Problem: Freeing wrong memory when manipulating buffers in autocommands. (James McCoy) Solution: Also set the w_s pointer if w_buffer was NULL. Files: src/ex_cmds.c *** ../vim-8.0.0706/src/ex_cmds.c 2017-06-25 21:17:18.579532117 +0200 --- src/ex_cmds.c 2017-07-11 17:41:03.303101905 +0200 *************** *** 3968,3975 **** * 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)) curwin->w_s = &(buf->b_s); #endif curwin->w_buffer = buf; --- 3968,3975 ---- * 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)) curwin->w_s = &(buf->b_s); #endif curwin->w_buffer = buf; *** ../vim-8.0.0706/src/version.c 2017-07-11 15:11:44.280333888 +0200 --- src/version.c 2017-07-11 18:27:57.545658889 +0200 *************** *** 766,767 **** --- 766,769 ---- { /* Add new patch number below this line */ + /**/ + 707, /**/ -- hundred-and-one symptoms of being an internet addict: 138. You develop a liking for cold coffee. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///