Mercurial > vim
comparison src/if_cscope.c @ 8234:dc72f4a463e4 v7.4.1410
commit https://github.com/vim/vim/commit/42dd7aee41ffcc5afdbf9bb83d70e7123261cada
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Feb 23 22:50:12 2016 +0100
patch 7.4.1410
Problem: Leaking memory in cscope interface.
Solution: Free memory when no tab is found. (Christian Brabandt)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 23 Feb 2016 23:00:05 +0100 |
parents | cb0edf7bd0a4 |
children | 387cd517939f |
comparison
equal
deleted
inserted
replaced
8233:0b7d02552c6e | 8234:dc72f4a463e4 |
---|---|
2060 return; | 2060 return; |
2061 | 2061 |
2062 strcpy(tbuf, matches[0]); | 2062 strcpy(tbuf, matches[0]); |
2063 ptag = strtok(tbuf, "\t"); | 2063 ptag = strtok(tbuf, "\t"); |
2064 if (ptag == NULL) | 2064 if (ptag == NULL) |
2065 { | |
2066 vim_free(tbuf); | |
2065 return; | 2067 return; |
2068 } | |
2066 | 2069 |
2067 newsize = (int)(strlen(cstag_msg) + strlen(ptag)); | 2070 newsize = (int)(strlen(cstag_msg) + strlen(ptag)); |
2068 buf = (char *)alloc(newsize); | 2071 buf = (char *)alloc(newsize); |
2069 if (buf != NULL) | 2072 if (buf != NULL) |
2070 { | 2073 { |