0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 7.4.1406

Problem:    Leaking memory in cs_print_tags_priv().
Solution:   Free tbuf. (idea by Forrest Fleming)
This commit is contained in:
Bram Moolenaar
2016-02-23 20:44:08 +01:00
parent 8aefbe0ad5
commit e16e5a9d8d
2 changed files with 8 additions and 5 deletions

View File

@@ -2092,12 +2092,13 @@ cs_print_tags_priv(char **matches, char **cntxts, int num_matches)
continue;
(void)strcpy(tbuf, matches[idx]);
if (strtok(tbuf, (const char *)"\t") == NULL)
continue;
if ((fname = strtok(NULL, (const char *)"\t")) == NULL)
continue;
if ((lno = strtok(NULL, (const char *)"\t")) == NULL)
if (strtok(tbuf, (const char *)"\t") == NULL
|| (fname = strtok(NULL, (const char *)"\t")) == NULL
|| (lno = strtok(NULL, (const char *)"\t")) == NULL)
{
vim_free(tbuf);
continue;
}
extra = strtok(NULL, (const char *)"\t");
lno[strlen(lno)-2] = '\0'; /* ignore ;" at the end */

View File

@@ -748,6 +748,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1406,
/**/
1405,
/**/