diff --git a/testmemleak.cpp b/testmemleak.cpp index 5c43d08dc..2110f533d 100644 --- a/testmemleak.cpp +++ b/testmemleak.cpp @@ -127,6 +127,7 @@ private: TEST_CASE( func9 ); // Embedding the function call in a if-condition TEST_CASE( func10 ); // Bug 2458510 - Function pointer TEST_CASE( func11 ); // Bug 2458510 - Function pointer + // TODO TEST_CASE( func12 ); TEST_CASE( class1 ); TEST_CASE( class2 ); @@ -1023,6 +1024,22 @@ private: ASSERT_EQUALS( std::string(""), errout.str() ); } + void func12() + { + check( "static void f()\n" + "{\n" + " char *buf = NULL, *tmp;\n" + " if (!(tmp = realloc(buf, 50)))\n" + " {\n" + " free(buf);\n" + " return NULL;\n" + " }\n" + " buf = tmp;\n" + " return buf;\n" + "}\n" ); + ASSERT_EQUALS( std::string(""), errout.str() ); + } + /* void func3()