diff --git a/lib/checkmemoryleak.cpp b/lib/checkmemoryleak.cpp index 0b13000a4..38e8c804d 100644 --- a/lib/checkmemoryleak.cpp +++ b/lib/checkmemoryleak.cpp @@ -2590,8 +2590,8 @@ void CheckMemoryLeakStructMember::checkStructVariable(const Variable * const var // Struct member is allocated => check if it is also properly deallocated.. else if (Token::Match(tok2->previous(), "[;{}] %varid% . %var% = malloc|strdup|kmalloc (", variable->varId()) - || Token::Match(tok2->previous(), "[;{}] %varid% . %var% = new ", variable->varId()) - || Token::Match(tok2->previous(), "[;{}] %varid% . %var% = fopen (", variable->varId())) { + || Token::Match(tok2->previous(), "[;{}] %varid% . %var% = new ", variable->varId()) + || Token::Match(tok2->previous(), "[;{}] %varid% . %var% = fopen (", variable->varId())) { const unsigned int structid(variable->varId()); const unsigned int structmemberid(tok2->tokAt(2)->varId()); @@ -2611,9 +2611,9 @@ void CheckMemoryLeakStructMember::checkStructVariable(const Variable * const var // Deallocating the struct member.. else if (Token::Match(tok3, "free|kfree ( %var% . %varid% )", structmemberid) - || Token::Match(tok3, "delete %var% . %varid%", structmemberid) - || Token::Match(tok3, "delete [ ] %var% . %varid%", structmemberid) - || Token::Match(tok3, "fclose ( %var% . %varid%", structmemberid)) { + || Token::Match(tok3, "delete %var% . %varid%", structmemberid) + || Token::Match(tok3, "delete [ ] %var% . %varid%", structmemberid) + || Token::Match(tok3, "fclose ( %var% . %varid%", structmemberid)) { // If the deallocation happens at the base level, don't check this member anymore if (indentlevel3 == 0) break; diff --git a/test/testmemleak.cpp b/test/testmemleak.cpp index 51a41fddc..c1990ab99 100644 --- a/test/testmemleak.cpp +++ b/test/testmemleak.cpp @@ -5325,7 +5325,7 @@ private: // Ticket #933 Leaks with struct members not detected void localvars() { - // Test error case + // Test error case const char code_err[] = "struct A {\n" " FILE* f;\n" " char* c;\n"