Plug a memory leak in the C tag parser
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5564 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
a2d04123bb
commit
d41435537f
@ -2891,6 +2891,7 @@ static void tagCheck (statementInfo *const st)
|
||||
else if (isContextualStatement (st))
|
||||
{
|
||||
tokenInfo *name_token = (tokenInfo *)prev;
|
||||
boolean free_name_token = FALSE;
|
||||
|
||||
if (isType (name_token, TOKEN_NAME))
|
||||
{
|
||||
@ -2927,6 +2928,7 @@ static void tagCheck (statementInfo *const st)
|
||||
char buffer[64];
|
||||
|
||||
name_token = newToken ();
|
||||
free_name_token = TRUE;
|
||||
copyToken (name_token, contextual_token);
|
||||
|
||||
sprintf(buffer, "anon_%s_%d", name_token->name->buffer, contextual_fake_count++);
|
||||
@ -2945,6 +2947,8 @@ static void tagCheck (statementInfo *const st)
|
||||
}
|
||||
}
|
||||
qualifyBlockTag (st, name_token);
|
||||
if (free_name_token)
|
||||
deleteToken (name_token);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user