Merge pull request #509 from Dmitry-Me/mergeOverlappingPatterns2

Merge overlapping patterns
This commit is contained in:
Daniel Marjamäki 2015-02-05 20:04:16 +01:00
commit f19d4afcde
1 changed files with 2 additions and 3 deletions

View File

@ -2532,9 +2532,8 @@ void CheckMemoryLeakStructMember::checkStructVariable(const Variable * const var
break;
// Struct member is allocated => check if it is also properly deallocated..
else if (Token::Match(tok2->previous(), "[;{}] %varid% . %var% = malloc|strdup|kmalloc (", variable->declarationId())
|| Token::Match(tok2->previous(), "[;{}] %varid% . %var% = new", variable->declarationId())
|| Token::Match(tok2->previous(), "[;{}] %varid% . %var% = fopen (", variable->declarationId())) {
else if (Token::Match(tok2->previous(), "[;{}] %varid% . %var% = malloc|strdup|kmalloc|fopen (", variable->declarationId())
|| Token::Match(tok2->previous(), "[;{}] %varid% . %var% = new", variable->declarationId())) {
const unsigned int structid(variable->declarationId());
const unsigned int structmemberid(tok2->tokAt(2)->varId());