Skip to content

Commit cc18b8d

Browse files
committed
Merge overlapping patterns
1 parent d2552dd commit cc18b8d

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lib/checkmemoryleak.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2532,9 +2532,8 @@ void CheckMemoryLeakStructMember::checkStructVariable(const Variable * const var
25322532
break;
25332533

25342534
// Struct member is allocated => check if it is also properly deallocated..
2535-
else if (Token::Match(tok2->previous(), "[;{}] %varid% . %var% = malloc|strdup|kmalloc (", variable->declarationId())
2536-
|| Token::Match(tok2->previous(), "[;{}] %varid% . %var% = new", variable->declarationId())
2537-
|| Token::Match(tok2->previous(), "[;{}] %varid% . %var% = fopen (", variable->declarationId())) {
2535+
else if (Token::Match(tok2->previous(), "[;{}] %varid% . %var% = malloc|strdup|kmalloc|fopen (", variable->declarationId())
2536+
|| Token::Match(tok2->previous(), "[;{}] %varid% . %var% = new", variable->declarationId())) {
25382537
const unsigned int structid(variable->declarationId());
25392538
const unsigned int structmemberid(tok2->tokAt(2)->varId());
25402539

0 commit comments

Comments
 (0)