Memory leak: find memory leak in TestMemleak::unknownFunction2
This commit is contained in:
parent
0361c9d338
commit
81ed48562c
|
@ -851,6 +851,13 @@ void CheckMemoryLeakClass::simplifycode(Token *tok)
|
|||
done = false;
|
||||
}
|
||||
|
||||
// Remove "if { dealloc ; callfunc ; } !!else"
|
||||
else if (Token::Match(tok2->next(), "if { dealloc|assign|use ; callfunc ; } !!else"))
|
||||
{
|
||||
erase(tok2, tok2->tokAt(8));
|
||||
done = false;
|
||||
}
|
||||
|
||||
// Reducing if..
|
||||
else if (_settings._showAll)
|
||||
{
|
||||
|
|
|
@ -189,7 +189,7 @@ private:
|
|||
|
||||
// Calls to unknown functions.. they may throw exception, quit the program, etc
|
||||
TEST_CASE(unknownFunction1);
|
||||
// TODO TEST_CASE(unknownFunction2);
|
||||
TEST_CASE(unknownFunction2);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1853,7 +1853,7 @@ private:
|
|||
" ThrowException();\n"
|
||||
" }\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("[test.cpp:9] (error) Memory leak: p\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:9]: (error) Memory leak: p\n", errout.str());
|
||||
}
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue