From fcbd297ff01ef152ede574de9ddc6a22a6fb9999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 15 Aug 2008 17:40:08 +0000 Subject: [PATCH] tests: Added memory leak test that gives a false positive --- tests.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests.cpp b/tests.cpp index d85a5f847..a809aa7ca 100644 --- a/tests.cpp +++ b/tests.cpp @@ -608,6 +608,16 @@ static void memleak_in_function() check( CheckMemoryLeak, __LINE__, code, "" ); + code = "static char *f()\n" + "{\n" + " char *s = new char[10];\n" + " if ( s )\n" + " {\n" + " return s;\n" + " }\n" + " return 0;\n" + "}\n"; + check( CheckMemoryLeak, __LINE__, code, "" );