From b7447a909fc668b023e86ca40c0e2738dd2e5350 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 29 Jan 2020 21:01:59 -0500 Subject: [PATCH] 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 --- src/nvim/tag.c | 6 ++++-- 1 file 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);