From aa66f2487edde49b9a5ba10cd70d706d06a94e25 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Tue, 16 Sep 2014 19:32:25 +0900 Subject: vim-patch:7.4.369 Problem: Using freed memory when exiting while compiled with EXITFREE. Solution: Set curwin to NULL and check for that. (Dominique Pelle) https://code.google.com/p/vim/source/detail?r=v7-4-369 --- src/nvim/window.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/nvim/window.c') diff --git a/src/nvim/window.c b/src/nvim/window.c index dccf3e2efc..27fb160035 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -2001,6 +2001,10 @@ void win_free_all(void) while (firstwin != NULL) (void)win_free_mem(firstwin, &dummy, NULL); + + // No window should be used after this. Set curwin to NULL to crash + // instead of using freed memory. + curwin = NULL; } #endif -- cgit