summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-07-27 22:03:50 +0200
committerBram Moolenaar <Bram@vim.org>2017-07-27 22:03:50 +0200
commitd28cc3f55d4a5a980f6ac6fa682382822a223720 (patch)
treeafbd1226f742817a8a86a8d256587bf2a93a7daf /src/window.c
parentab6eec3887d68c260b50b1b8f9ed95d49d9306c6 (diff)
downloadvim-d28cc3f55d4a5a980f6ac6fa682382822a223720.zip
patch 8.0.0782: using freed memory in quickfix code
Problem: Using freed memory in quickfix code. (Dominique Pelle) Solution: Handle a help window differently. (Yegappan Lakshmanan)
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/window.c b/src/window.c
index 192721708..948303c09 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2314,7 +2314,7 @@ win_close(win_T *win, int free_buf)
/* When closing the help window, try restoring a snapshot after closing
* the window. Otherwise clear the snapshot, it's now invalid. */
- if (win->w_buffer != NULL && win->w_buffer->b_help)
+ if (bt_help(win->w_buffer))
help_window = TRUE;
else
clear_snapshot(curtab, SNAP_HELP_IDX);
@@ -2397,7 +2397,7 @@ win_close(win_T *win, int free_buf)
&& (last_window() || curtab != prev_curtab
|| close_last_window_tabpage(win, free_buf, prev_curtab)))
{
- /* Autocommands have close all windows, quit now. Restore
+ /* Autocommands have closed all windows, quit now. Restore
* curwin->w_buffer, otherwise writing viminfo may fail. */
if (curwin->w_buffer == NULL)
curwin->w_buffer = curbuf;
@@ -6479,7 +6479,7 @@ only_one_window(void)
FOR_ALL_WINDOWS(wp)
if (wp->w_buffer != NULL
- && (!((wp->w_buffer->b_help && !curbuf->b_help)
+ && (!((bt_help(wp->w_buffer) && !bt_help(curbuf))
# ifdef FEAT_QUICKFIX
|| wp->w_p_pvw
# endif