summaryrefslogtreecommitdiff
path: root/src/schedule
diff options
context:
space:
mode:
authortradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>2002-06-27 12:51:45 +0000
committertradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>2002-06-27 12:51:45 +0000
commit1c34ddc596dbd0ee8c9f9bba6245d381aed5a013 (patch)
treec7bf0a7b35cb5042c5b8e2a9ad27853f047a5784 /src/schedule
parent253b8517e8f8080d46cb7b284417c5f93fcf972b (diff)
Catch malloc() of zero bytes explicitely.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@2918 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/schedule')
-rw-r--r--src/schedule/ScheduleSorter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/schedule/ScheduleSorter.c b/src/schedule/ScheduleSorter.c
index 2871d4ca..3856240b 100644
--- a/src/schedule/ScheduleSorter.c
+++ b/src/schedule/ScheduleSorter.c
@@ -228,7 +228,7 @@ signed char **CCTKi_ScheduleCreateArray(int size)
int i, j;
signed char **array;
- array = (signed char **)malloc(size*sizeof(signed char *));
+ array = size > 0 ? (signed char **)malloc(size*sizeof(signed char *)) : NULL;
if(array)
{
@@ -338,7 +338,7 @@ int *CCTKi_ScheduleCreateIVec(int size)
int i;
int *vector;
- vector = (int *)malloc(size*sizeof(int));
+ vector = size > 0 ? (int *)malloc(size*sizeof(int)) : NULL;
if(vector)
{