Merge pull request #509 from Dmitry-Me/mergeOverlappingPatterns2
Merge overlapping patterns
This commit is contained in:
commit
f19d4afcde
|
@ -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());
|
||||
|
||||
|
|
Loading…
Reference in New Issue