From 2848c61e8856a6973765691d573a0ff6a90d6cc1 Mon Sep 17 00:00:00 2001 From: Ettl Martin Date: Thu, 26 Apr 2012 13:37:13 +0200 Subject: [PATCH] #3344 added missing testcase --- test/testuninitvar.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/testuninitvar.cpp b/test/testuninitvar.cpp index 1f1c00b57..6343457a9 100644 --- a/test/testuninitvar.cpp +++ b/test/testuninitvar.cpp @@ -1163,6 +1163,15 @@ private: " return a[0];\n" "}"); 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..