]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.369 v7.4.369
authorBram Moolenaar <Bram@vim.org>
Wed, 16 Jul 2014 14:30:28 +0000 (16:30 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 16 Jul 2014 14:30:28 +0000 (16:30 +0200)
Problem:    Using freed memory when exiting while compiled with EXITFREE.
Solution:   Set curwin to NULL and check for that. (Dominique Pelle)

src/buffer.c
src/version.c
src/window.c

index 7a6dbc5917e396dd8122b857e404a09143bddf5f..5a9f8a786c493f0bc99560ea6a30921661ef8290 100644 (file)
@@ -5702,8 +5702,8 @@ buf_delete_signs(buf)
     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();
index 407541af05835318b8c6062030a56a3fbd30e454..cd1ce94c5b4cff6bcfdb016b4c8c9fa2d12e454a 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    369,
 /**/
     368,
 /**/
index cbf0ff86b4a0e43423b87eaf472189f2484e2c3e..de85739a0e28cd7e854be27dde849188056817e3 100644 (file)
@@ -2489,6 +2489,10 @@ win_free_all()
 
     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