diff src/window.c @ 11593:c4e7fe672a72 v8.0.0679

patch 8.0.0679: using freed memory commit https://github.com/vim/vim/commit/41cc038ff83498c589c7d25b3d2984145528eb92 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jun 26 09:59:35 2017 +0200 patch 8.0.0679: using freed memory Problem: Using freed memory. Solution: Get the parent frame pointer earlier.
author Christian Brabandt <cb@256bit.org>
date Mon, 26 Jun 2017 10:00:03 +0200
parents d06a3db9b651
children 5ceaecedbad2
line wrap: on
line diff
--- a/src/window.c
+++ b/src/window.c
@@ -2282,7 +2282,7 @@ win_close(win_T *win, int free_buf)
     int		dir;
     int		help_window = FALSE;
     tabpage_T   *prev_curtab = curtab;
-    frame_T	*win_frame = win->w_frame;
+    frame_T	*win_frame = win->w_frame->fr_parent;
 
     if (last_window())
     {
@@ -2462,8 +2462,7 @@ win_close(win_T *win, int free_buf)
     if (p_ea && (*p_ead == 'b' || *p_ead == dir))
 	/* If the frame of the closed window contains the new current window,
 	 * only resize that frame.  Otherwise resize all windows. */
-	win_equal(curwin,
-		      curwin->w_frame->fr_parent == win_frame->fr_parent, dir);
+	win_equal(curwin, curwin->w_frame->fr_parent == win_frame, dir);
     else
 	win_comp_pos();
     if (close_curwin)