diff --git a/testmemleak.cpp b/testmemleak.cpp index ef58d5d62..9f6f6d625 100644 --- a/testmemleak.cpp +++ b/testmemleak.cpp @@ -1044,6 +1044,15 @@ private: " free(a - 10);\n" "}\n" ); + ASSERT_EQUALS( std::string(""), errout.str() ); + + check( "void foo()\n" + "{\n" + " char *a = (char *)malloc(10);\n" + " a = a + 10;\n" + " free(a - 10);\n" + "}\n" ); + ASSERT_EQUALS( std::string(""), errout.str() ); }