diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-02-23 22:50:12 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-02-23 22:50:12 +0100 |
commit | 42dd7aee41ffcc5afdbf9bb83d70e7123261cada (patch) | |
tree | d7f9685c4e8ce2966dfc57bcd4fd4f1d228e1f15 /src/if_cscope.c | |
parent | 1858a842af5e3b07157add378ee3fd7b512cfea6 (diff) | |
download | vim-42dd7aee41ffcc5afdbf9bb83d70e7123261cada.zip |
patch 7.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.c | 3 |
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); |