diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-01-29 21:01:59 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-01-29 22:18:58 -0500 |
commit | b7447a909fc668b023e86ca40c0e2738dd2e5350 (patch) | |
tree | adb5f5b3cb5ff71ec437539136b5f680a46b8de3 | |
parent | 31f31b40a8af67a3a55e85fa5dfa63d5a5999acc (diff) | |
download | rneovim-b7447a909fc668b023e86ca40c0e2738dd2e5350.tar.gz rneovim-b7447a909fc668b023e86ca40c0e2738dd2e5350.tar.bz2 rneovim-b7447a909fc668b023e86ca40c0e2738dd2e5350.zip |
vim-patch:8.2.0177: memory leak in get_tags()
Problem: Memory leak in get_tags().
Solution: Free matches when finding a pseudo-tag line. (Dominique Pelle,
closes vim/vim#5553)
https://github.com/vim/vim/commit/70b3e706b40fc2c84c1f9f33fa64945a481df395
-rw-r--r-- | src/nvim/tag.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/tag.c b/src/nvim/tag.c index 07f29977aa..57bb43c846 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -3158,9 +3158,11 @@ int get_tags(list_T *list, char_u *pat, char_u *buf_fname) is_static = test_for_static(&tp); - /* Skip pseudo-tag lines. */ - if (STRNCMP(tp.tagname, "!_TAG_", 6) == 0) + // Skip pseudo-tag lines. + if (STRNCMP(tp.tagname, "!_TAG_", 6) == 0) { + xfree(matches[i]); continue; + } dict = tv_dict_alloc(); tv_list_append_dict(list, dict); |