0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.0.0331: restoring help snapshot accesses freed memory

Problem:    Restoring help snapshot accesses freed memory. (Dominique Pelle)
Solution:   Don't restore a snapshot when the window closes.
This commit is contained in:
Bram Moolenaar
2017-02-17 12:04:56 +01:00
parent 84b2a38145
commit 343b8c0429
5 changed files with 17 additions and 2 deletions

View File

@@ -6551,7 +6551,7 @@ restore_snapshot(
/*
* Check if frames "sn" and "fr" have the same layout, same following frames
* and same children.
* and same children. And the window pointer is valid.
*/
static int
check_snapshot_rec(frame_T *sn, frame_T *fr)
@@ -6562,7 +6562,8 @@ check_snapshot_rec(frame_T *sn, frame_T *fr)
|| (sn->fr_next != NULL
&& check_snapshot_rec(sn->fr_next, fr->fr_next) == FAIL)
|| (sn->fr_child != NULL
&& check_snapshot_rec(sn->fr_child, fr->fr_child) == FAIL))
&& check_snapshot_rec(sn->fr_child, fr->fr_child) == FAIL)
|| !win_valid(sn->fr_win))
return FAIL;
return OK;
}