#2540: added missing testcase.
This commit is contained in:
parent
30e8e389a7
commit
8494df74e6
|
@ -340,6 +340,7 @@ private:
|
||||||
TEST_CASE(jmp);
|
TEST_CASE(jmp);
|
||||||
|
|
||||||
TEST_CASE(trac1949);
|
TEST_CASE(trac1949);
|
||||||
|
TEST_CASE(trac2540);
|
||||||
|
|
||||||
// #2662: segfault because of endless recursion (call_func -> getAllocationType -> functionReturnType -> call_func ..)
|
// #2662: segfault because of endless recursion (call_func -> getAllocationType -> functionReturnType -> call_func ..)
|
||||||
TEST_CASE(trac2662);
|
TEST_CASE(trac2662);
|
||||||
|
@ -3705,6 +3706,22 @@ private:
|
||||||
ASSERT_EQUALS("[test.cpp:10]: (error) Memory leak: buff\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:10]: (error) Memory leak: buff\n", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void trac2540() {
|
||||||
|
check("void f()\n"
|
||||||
|
"{\n"
|
||||||
|
" char* str = strdup(\"abc def\");\n"
|
||||||
|
" char *name = strtok(str, \" \");\n"
|
||||||
|
"}\n");
|
||||||
|
ASSERT_EQUALS("[test.cpp:5]: (error) Memory leak: str\n", errout.str());
|
||||||
|
|
||||||
|
check("void f(char *cBuf)\n"
|
||||||
|
"{\n"
|
||||||
|
" char* str = strdup(*cBuf);\n"
|
||||||
|
" char *name = strtok(str, \" \");\n"
|
||||||
|
"}\n");
|
||||||
|
ASSERT_EQUALS("[test.cpp:5]: (error) Memory leak: str\n", errout.str());
|
||||||
|
}
|
||||||
|
|
||||||
void trac2662() {
|
void trac2662() {
|
||||||
// segfault because of endless recursion
|
// segfault because of endless recursion
|
||||||
// call_func -> getAllocationType -> functionReturnType -> call_func ..
|
// call_func -> getAllocationType -> functionReturnType -> call_func ..
|
||||||
|
|
Loading…
Reference in New Issue