OSDN Git Service

add allocate error check
authortsutsumi <>
Tue, 23 Sep 2003 14:22:48 +0000 (14:22 +0000)
committertsutsumi <>
Tue, 23 Sep 2003 14:22:48 +0000 (14:22 +0000)
src/ccunit/CCUnitTestCase.c

index 25841be..d645b6a 100755 (executable)
@@ -36,6 +36,8 @@ CCUnitTestCase* ccunit_newTestCase (const char* name,
                                    void (*runTest)())
 {
   CCUnitTestCase* testCase = calloc (1, sizeof (*testCase));
+  if (!testCase)
+    return NULL;
   testCase->name = safe_strdup (name);
   testCase->desc = !desc ? safe_strdup (name) : strdup (desc);
   testCase->runTest = runTest;