summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-01-29 22:38:45 +0100
committerBram Moolenaar <Bram@vim.org>2020-01-29 22:38:45 +0100
commit70b3e706b40fc2c84c1f9f33fa64945a481df395 (patch)
tree629d59ecf595bf544b8ebc218194c49b84f4a851
parente258368b4fb22fe5fc9bf510ac303a3542ff8e83 (diff)
patch 8.2.0177: memory leak in get_tags()v8.2.0177
Problem: Memory leak in get_tags(). Solution: Free matches when finding a pseudo-tag line. (Dominique Pelle, closes #5553)
-rw-r--r--src/tag.c3
-rw-r--r--src/version.c2
2 files changed, 5 insertions, 0 deletions
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;
diff --git a/src/version.c b/src/version.c
index fbb2ca554e..e6935a289b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -743,6 +743,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 177,
+/**/
176,
/**/
175,