Skip to content

Commit 4f19828

Browse files
committed
patch 8.0.1214: accessing freed memory when EXITFREE is set
Problem: Accessing freed memory when EXITFREE is set and there is more than one tab and window. (Dominique Pelle) Solution: Free options later. Skip redraw when exiting.
1 parent 2e4cb3b commit 4f19828

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/misc2.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,6 @@ free_all_mem(void)
11351135
free_all_autocmds();
11361136
# endif
11371137
clear_termcodes();
1138-
free_all_options();
11391138
free_all_marks();
11401139
alist_clear(&global_alist);
11411140
free_homedir();
@@ -1196,6 +1195,9 @@ free_all_mem(void)
11961195
/* Destroy all windows. Must come before freeing buffers. */
11971196
win_free_all();
11981197

1198+
/* Free all option values. Must come after closing windows. */
1199+
free_all_options();
1200+
11991201
/* Free all buffers. Reset 'autochdir' to avoid accessing things that
12001202
* were freed already. */
12011203
#ifdef FEAT_AUTOCHDIR

src/screen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ redraw_win_later(
203203
win_T *wp,
204204
int type)
205205
{
206-
if (wp->w_redr_type < type)
206+
if (!exiting && wp->w_redr_type < type)
207207
{
208208
wp->w_redr_type = type;
209209
if (type >= NOT_VALID)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ static char *(features[]) =
761761

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
1214,
764766
/**/
765767
1213,
766768
/**/

0 commit comments

Comments
 (0)