0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

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.
This commit is contained in:
Bram Moolenaar
2019-06-06 19:03:17 +02:00
parent 75ee544f99
commit c07f67ad0e
3 changed files with 14 additions and 6 deletions

View File

@@ -430,12 +430,11 @@ eval_clear(void)
vim_free(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