diff --git a/test/testmemleak.cpp b/test/testmemleak.cpp index 235e73d1b..9eb621d7d 100644 --- a/test/testmemleak.cpp +++ b/test/testmemleak.cpp @@ -173,6 +173,7 @@ private: // free a free'd pointer TEST_CASE(freefree1); TEST_CASE(freefree2); + // TODO TEST_CASE(strcat_result_assignment); } @@ -1668,6 +1669,21 @@ private: ASSERT_EQUALS(std::string(""), errout.str()); } + void strcat_result_assignment() + { + check("#include \n" + "#include \n" + "int main()\n" + "{\n" + "char *p = malloc(10);\n" + "p[0] = 0;\n" + "p = strcat( p, \"a\" );\n" + "free( p );\n" + "return 0;\n" + "}"); + ASSERT_EQUALS(std::string(""), errout.str()); + } + }; REGISTER_TEST(TestMemleak)