Merge overlapping patterns
This commit is contained in:
parent
d2552dd93a
commit
cc18b8d1bb
|
@ -2532,9 +2532,8 @@ void CheckMemoryLeakStructMember::checkStructVariable(const Variable * const var
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Struct member is allocated => check if it is also properly deallocated..
|
// Struct member is allocated => check if it is also properly deallocated..
|
||||||
else if (Token::Match(tok2->previous(), "[;{}] %varid% . %var% = malloc|strdup|kmalloc (", 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())
|
|| Token::Match(tok2->previous(), "[;{}] %varid% . %var% = new", variable->declarationId())) {
|
||||||
|| Token::Match(tok2->previous(), "[;{}] %varid% . %var% = fopen (", variable->declarationId())) {
|
|
||||||
const unsigned int structid(variable->declarationId());
|
const unsigned int structid(variable->declarationId());
|
||||||
const unsigned int structmemberid(tok2->tokAt(2)->varId());
|
const unsigned int structmemberid(tok2->tokAt(2)->varId());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue