aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2019-09-06 12:38:52 +0900
committererw7 <erw7.github@gmail.com>2020-05-25 18:52:30 +0900
commitc3dab08c8fcbb969805f8b8825475822d5e40469 (patch)
treec803f565cd0ff40300f43483f14198692e7b4619 /src/nvim/eval.c
parent0cab85df4d465fae2973571ebbddbde54d45482b (diff)
downloadrneovim-c3dab08c8fcbb969805f8b8825475822d5e40469.tar.gz
rneovim-c3dab08c8fcbb969805f8b8825475822d5e40469.tar.bz2
rneovim-c3dab08c8fcbb969805f8b8825475822d5e40469.zip
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
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c7
1 files changed, 3 insertions, 4 deletions
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