073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.369
073263
Fcc: outbox
073263
From: Bram Moolenaar <Bram@moolenaar.net>
073263
Mime-Version: 1.0
073263
Content-Type: text/plain; charset=UTF-8
073263
Content-Transfer-Encoding: 8bit
073263
------------
073263
073263
Patch 7.4.369
073263
Problem:    Using freed memory when exiting while compiled with EXITFREE.
073263
Solution:   Set curwin to NULL and check for that. (Dominique Pelle)
073263
Files:	    src/buffer.c, src/window.c
073263
073263
073263
*** ../vim-7.4.368/src/buffer.c	2014-06-12 14:01:27.571769788 +0200
073263
--- src/buffer.c	2014-07-16 16:20:04.443621254 +0200
073263
***************
073263
*** 5702,5709 ****
073263
      signlist_T	*next;
073263
  
073263
      /* When deleting the last sign need to redraw the windows to remove the
073263
!      * sign column. */
073263
!     if (buf->b_signlist != NULL)
073263
      {
073263
  	redraw_buf_later(buf, NOT_VALID);
073263
  	changed_cline_bef_curs();
073263
--- 5702,5709 ----
073263
      signlist_T	*next;
073263
  
073263
      /* When deleting the last sign need to redraw the windows to remove the
073263
!      * sign column. Not when curwin is NULL (this means we're exiting). */
073263
!     if (buf->b_signlist != NULL && curwin != NULL)
073263
      {
073263
  	redraw_buf_later(buf, NOT_VALID);
073263
  	changed_cline_bef_curs();
073263
*** ../vim-7.4.368/src/window.c	2014-07-16 15:18:22.903696486 +0200
073263
--- src/window.c	2014-07-16 16:15:41.063626607 +0200
073263
***************
073263
*** 2489,2494 ****
073263
--- 2489,2498 ----
073263
  
073263
      while (firstwin != NULL)
073263
  	(void)win_free_mem(firstwin, &dummy, NULL);
073263
+ 
073263
+     /* No window should be used after this. Set curwin to NULL to crash
073263
+      * instead of using freed memory. */
073263
+     curwin = NULL;
073263
  }
073263
  #endif
073263
  
073263
*** ../vim-7.4.368/src/version.c	2014-07-16 15:18:22.907696486 +0200
073263
--- src/version.c	2014-07-16 16:18:36.827623035 +0200
073263
***************
073263
*** 736,737 ****
073263
--- 736,739 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     369,
073263
  /**/
073263
073263
-- 
073263
ARTHUR: If you do not open these doors, we will take this castle by force ...
073263
   [A bucket of slops land on ARTHUR.  He tries to retain his dignity.]
073263
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
073263
073263
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
073263
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
073263
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
073263
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///