#3344 added missing testcase

This commit is contained in:
Ettl Martin 2012-04-26 13:37:13 +02:00
parent 8494df74e6
commit 2848c61e88
1 changed files with 9 additions and 0 deletions

View File

@ -1163,6 +1163,15 @@ private:
" return a[0];\n" " return a[0];\n"
"}"); "}");
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
// ticket #3344
checkUninitVar("void f(){\n"
" char *strMsg = \"This is a message\";\n"
" char *buffer=(char*)malloc(128*sizeof(char));\n"
" strcpy(strMsg,buffer);\n"
" free(buffer);\n"
"}\n");
ASSERT_EQUALS("[test.cpp:4]: (error) Data is allocated but not initialized: buffer\n", errout.str());
} }
// alloc.. // alloc..