commit | 42dd7aee41ffcc5afdbf9bb83d70e7123261cada | [log] [tgz] |
---|---|---|
author | Bram Moolenaar <Bram@vim.org> | Tue Feb 23 22:50:12 2016 +0100 |
committer | Bram Moolenaar <Bram@vim.org> | Tue Feb 23 22:50:12 2016 +0100 |
tree | d7f9685c4e8ce2966dfc57bcd4fd4f1d228e1f15 | |
parent | 1858a842af5e3b07157add378ee3fd7b512cfea6 [diff] [blame] |
patch 7.4.1410 Problem: Leaking memory in cscope interface. Solution: Free memory when no tab is found. (Christian Brabandt)
diff --git a/src/if_cscope.c b/src/if_cscope.c index b5ca614..2f75390 100644 --- a/src/if_cscope.c +++ b/src/if_cscope.c
@@ -2062,7 +2062,10 @@ 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);