Skip to content

Commit f1d1347

Browse files
committed
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.
1 parent 5a15b6a commit f1d1347

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/ex_cmds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3968,8 +3968,8 @@ do_ecmd(
39683968
* <VN> We could instead free the synblock
39693969
* and re-attach to buffer, perhaps.
39703970
*/
3971-
if (curwin->w_buffer != NULL
3972-
&& curwin->w_s == &(curwin->w_buffer->b_s))
3971+
if (curwin->w_buffer == NULL
3972+
|| curwin->w_s == &(curwin->w_buffer->b_s))
39733973
curwin->w_s = &(buf->b_s);
39743974
#endif
39753975
curwin->w_buffer = buf;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
707,
767769
/**/
768770
706,
769771
/**/

0 commit comments

Comments
 (0)