viml/profile: fix use after free

fixes #12255.
This commit is contained in:
erw7
2020-05-08 12:05:34 +09:00
parent 9a67b030d9
commit 861aade680

View File

@@ -1045,9 +1045,10 @@ static void profile_reset(void)
uf->uf_tm_self = profile_zero(); uf->uf_tm_self = profile_zero();
uf->uf_tm_children = profile_zero(); uf->uf_tm_children = profile_zero();
XFREE_CLEAR(uf->uf_tml_count); for (int i = 0; i < uf->uf_lines.ga_len; i++) {
XFREE_CLEAR(uf->uf_tml_total); uf->uf_tml_count[i] = 0;
XFREE_CLEAR(uf->uf_tml_self); uf->uf_tml_total[i] = uf->uf_tml_self[i] = 0;
}
uf->uf_tml_start = profile_zero(); uf->uf_tml_start = profile_zero();
uf->uf_tml_children = profile_zero(); uf->uf_tml_children = profile_zero();