summaryrefslogtreecommitdiff
path: root/src/if_cscope.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-02-23 22:50:12 +0100
committerBram Moolenaar <Bram@vim.org>2016-02-23 22:50:12 +0100
commit42dd7aee41ffcc5afdbf9bb83d70e7123261cada (patch)
treed7f9685c4e8ce2966dfc57bcd4fd4f1d228e1f15 /src/if_cscope.c
parent1858a842af5e3b07157add378ee3fd7b512cfea6 (diff)
downloadvim-git-42dd7aee41ffcc5afdbf9bb83d70e7123261cada.tar.gz
patch 7.4.1410v7.4.1410
Problem: Leaking memory in cscope interface. Solution: Free memory when no tab is found. (Christian Brabandt)
Diffstat (limited to 'src/if_cscope.c')
-rw-r--r--src/if_cscope.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/if_cscope.c b/src/if_cscope.c
index b5ca6148b..2f75390b9 100644
--- a/src/if_cscope.c
+++ b/src/if_cscope.c
@@ -2062,7 +2062,10 @@ cs_print_tags_priv(char **matches, char **cntxts, int num_matches)
strcpy(tbuf, matches[0]);
ptag = strtok(tbuf, "\t");
if (ptag == NULL)
+ {
+ vim_free(tbuf);
return;
+ }
newsize = (int)(strlen(cstag_msg) + strlen(ptag));
buf = (char *)alloc(newsize);