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)
diff --git a/src/buffer.c b/src/buffer.c
index 7a6dbc5..5a9f8a7 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5702,8 +5702,8 @@
signlist_T *next;
/* When deleting the last sign need to redraw the windows to remove the
- * sign column. */
- if (buf->b_signlist != NULL)
+ * sign column. Not when curwin is NULL (this means we're exiting). */
+ if (buf->b_signlist != NULL && curwin != NULL)
{
redraw_buf_later(buf, NOT_VALID);
changed_cline_bef_curs();
diff --git a/src/version.c b/src/version.c
index 407541a..cd1ce94 100644
--- a/src/version.c
+++ b/src/version.c
@@ -735,6 +735,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 369,
+/**/
368,
/**/
367,
diff --git a/src/window.c b/src/window.c
index cbf0ff8..de85739 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2489,6 +2489,10 @@
while (firstwin != NULL)
(void)win_free_mem(firstwin, &dummy, NULL);
+
+ /* No window should be used after this. Set curwin to NULL to crash
+ * instead of using freed memory. */
+ curwin = NULL;
}
#endif