From d41435537fa6821dd7dd66f710a4a851d75efdb7 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Sat, 5 Mar 2011 22:54:33 +0000 Subject: [PATCH] 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 --- tagmanager/c.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tagmanager/c.c b/tagmanager/c.c index e7cb0178..2d2352c3 100644 --- a/tagmanager/c.c +++ b/tagmanager/c.c @@ -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; }