Ferite: Fix a memory leak

This commit is contained in:
Colomban Wendling 2016-10-09 12:58:44 +02:00
parent 7ae1d031ef
commit 87111f268f

View File

@ -1440,7 +1440,7 @@ static void makeTag (const tokenInfo *const token,
if (isType (token, TOKEN_NAME) && vStringLength (token->name) > 0 /* && if (isType (token, TOKEN_NAME) && vStringLength (token->name) > 0 /* &&
includeTag (type, isFileScope) */) includeTag (type, isFileScope) */)
{ {
vString *scope = vStringNew (); vString *scope;
tagEntryInfo e; tagEntryInfo e;
/* take only functions which are introduced by "function ..." */ /* take only functions which are introduced by "function ..." */
@ -1456,6 +1456,7 @@ static void makeTag (const tokenInfo *const token,
e.filePosition = token->filePosition; e.filePosition = token->filePosition;
e.isFileScope = isFileScope; e.isFileScope = isFileScope;
scope = vStringNew ();
findScopeHierarchy (scope, st); findScopeHierarchy (scope, st);
addOtherFields (&e, type, token, st, scope); addOtherFields (&e, type, token, st, scope);