CheckMemoryLeak.cpp: Minor improvements to avoid false positives

This commit is contained in:
Daniel Marjamäki 2008-05-03 07:16:22 +00:00
parent 77389640cf
commit 15fe28272c
1 changed files with 4 additions and 3 deletions

View File

@ -156,11 +156,12 @@ static void CheckMemoryLeak_CheckScope( const TOKEN *Tok1, const char varname[]
isif = false;
// Allocated..
if ( Match(tok, "%var1% =", varnames) )
if ( Match(tok, "[(;{}] %var1% =", varnames) )
{
AllocType alloc = GetAllocationType( gettok(tok, 2) );
AllocType alloc = GetAllocationType( gettok(tok, 3) );
if ( alloc != No )
{
tok = tok->next;
Alloc = alloc;
alloc_indentlevel = indentlevel;