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.
c07f67ad0e
This commit is contained in:
erw7
2019-09-06 12:38:52 +09:00
parent 0cab85df4d
commit c3dab08c8f
2 changed files with 14 additions and 6 deletions

View File

@@ -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