From c3dab08c8fcbb969805f8b8825475822d5e40469 Mon Sep 17 00:00:00 2001 From: erw7 Date: Fri, 6 Sep 2019 12:38:52 +0900 Subject: vim-patch:8.1.1485: double free when garbage_collect() is used in autocommand Problem: Double free when garbage_collect() is used in autocommand. Solution: Have garbage collection also set the copyID in funccal_stack. https://github.com/vim/vim/commit/c07f67ad0e9c48a07d49f2d67eb63e183a22386a --- src/nvim/eval.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/nvim/eval.c') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index b31b6bd0f8..e24605f25f 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -439,12 +439,11 @@ void eval_clear(void) xfree(SCRIPT_SV(i)); ga_clear(&ga_scripts); - // functions need to be freed before gargabe collecting, otherwise local - // variables might be freed twice. - free_all_functions(); - // unreferenced lists and dicts (void)garbage_collect(false); + + // functions not garbage collected + free_all_functions(); } #endif -- cgit