From: Bram Moolenaar Date: Tue, 23 Feb 2016 19:44:08 +0000 (+0100) Subject: patch 7.4.1406 X-Git-Tag: v7.4.1406 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e16e5a9d8d6d3159107541a259c6823ade18fd08;p=thirdparty%2Fvim.git patch 7.4.1406 Problem: Leaking memory in cs_print_tags_priv(). Solution: Free tbuf. (idea by Forrest Fleming) --- diff --git a/src/if_cscope.c b/src/if_cscope.c index c135fe5bbc..b5ca6148b9 100644 --- a/src/if_cscope.c +++ b/src/if_cscope.c @@ -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 */ diff --git a/src/version.c b/src/version.c index 5696dfc4b8..a04a948c66 100644 --- a/src/version.c +++ b/src/version.c @@ -748,6 +748,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1406, /**/ 1405, /**/