Skip to content

Commit 0154919

Browse files
committed
updated for version 7.4.369
Problem: Using freed memory when exiting while compiled with EXITFREE. Solution: Set curwin to NULL and check for that. (Dominique Pelle)
1 parent 658faad commit 0154919

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/buffer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5702,8 +5702,8 @@ buf_delete_signs(buf)
57025702
signlist_T *next;
57035703

57045704
/* When deleting the last sign need to redraw the windows to remove the
5705-
* sign column. */
5706-
if (buf->b_signlist != NULL)
5705+
* sign column. Not when curwin is NULL (this means we're exiting). */
5706+
if (buf->b_signlist != NULL && curwin != NULL)
57075707
{
57085708
redraw_buf_later(buf, NOT_VALID);
57095709
changed_cline_bef_curs();

src/version.c

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

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
369,
737739
/**/
738740
368,
739741
/**/

src/window.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2489,6 +2489,10 @@ win_free_all()
24892489

24902490
while (firstwin != NULL)
24912491
(void)win_free_mem(firstwin, &dummy, NULL);
2492+
2493+
/* No window should be used after this. Set curwin to NULL to crash
2494+
* instead of using freed memory. */
2495+
curwin = NULL;
24922496
}
24932497
#endif
24942498

0 commit comments

Comments
 (0)