From 4af96dd26a25ca409760e3a6a9354a1c0b366e42 Mon Sep 17 00:00:00 2001 From: tsntsumi Date: Tue, 23 Sep 2003 14:22:48 +0000 Subject: [PATCH] add allocate error check --- src/ccunit/CCUnitTestCase.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ccunit/CCUnitTestCase.c b/src/ccunit/CCUnitTestCase.c index 25841be..d645b6a 100755 --- a/src/ccunit/CCUnitTestCase.c +++ b/src/ccunit/CCUnitTestCase.c @@ -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; -- 2.11.0