diff --git a/lib/checkmemoryleak.cpp b/lib/checkmemoryleak.cpp index 06c6dc63e..97db0e1fa 100644 --- a/lib/checkmemoryleak.cpp +++ b/lib/checkmemoryleak.cpp @@ -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());