From 70b3e706b40fc2c84c1f9f33fa64945a481df395 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 29 Jan 2020 22:38:45 +0100 Subject: 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 #5553) --- src/tag.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/tag.c') diff --git a/src/tag.c b/src/tag.c index 4c6dadcf21..cfc300e465 100644 --- a/src/tag.c +++ b/src/tag.c @@ -3980,7 +3980,10 @@ get_tags(list_T *list, char_u *pat, char_u *buf_fname) // Skip pseudo-tag lines. if (STRNCMP(tp.tagname, "!_TAG_", 6) == 0) + { + vim_free(matches[i]); continue; + } if ((dict = dict_alloc()) == NULL) ret = FAIL; -- cgit v1.2.3