tests: Added memory leak test that gives a false positive
This commit is contained in:
parent
0ce33fe1da
commit
fcbd297ff0
10
tests.cpp
10
tests.cpp
|
@ -608,6 +608,16 @@ static void memleak_in_function()
|
||||||
check( CheckMemoryLeak, __LINE__, code, "" );
|
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, "" );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue