diff options
author | erw7 <erw7.github@gmail.com> | 2020-05-08 12:05:34 +0900 |
---|---|---|
committer | erw7 <erw7.github@gmail.com> | 2020-05-09 11:21:52 +0900 |
commit | 861aade680925a240e6f5ae2ba29513abc1eb8f6 (patch) | |
tree | e3770b63c3a51035d1e85997dcc19845d493c897 | |
parent | 9a67b030d9a054648296b45b615684dee768582d (diff) | |
download | rneovim-861aade680925a240e6f5ae2ba29513abc1eb8f6.tar.gz rneovim-861aade680925a240e6f5ae2ba29513abc1eb8f6.tar.bz2 rneovim-861aade680925a240e6f5ae2ba29513abc1eb8f6.zip |
viml/profile: fix use after free
fixes #12255.
-rw-r--r-- | src/nvim/ex_cmds2.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index fbdd64e43e..a6bc32581f 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -1045,9 +1045,10 @@ static void profile_reset(void) uf->uf_tm_self = profile_zero(); uf->uf_tm_children = profile_zero(); - XFREE_CLEAR(uf->uf_tml_count); - XFREE_CLEAR(uf->uf_tml_total); - XFREE_CLEAR(uf->uf_tml_self); + for (int i = 0; i < uf->uf_lines.ga_len; i++) { + uf->uf_tml_count[i] = 0; + uf->uf_tml_total[i] = uf->uf_tml_self[i] = 0; + } uf->uf_tml_start = profile_zero(); uf->uf_tml_children = profile_zero(); |