From 8c80fa8851373e7dd978a3bf953c97ef69b42002 Mon Sep 17 00:00:00 2001 From: eschnett Date: Wed, 30 Apr 2014 12:48:27 +0000 Subject: Correct error check for malloc git-svn-id: http://svn.cactuscode.org/arrangements/CactusUtils/TimerReport/trunk@61 d0051148-8e13-4bef-be1d-f6c572c85f9f --- src/Output.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Output.c b/src/Output.c index 3efd95b..7a6f21e 100644 --- a/src/Output.c +++ b/src/Output.c @@ -684,9 +684,9 @@ static int CollectTimerInfo(cGH const *restrict const cctkGH, } /* Determine local timer names and their values */ - timername_t *my_timernames = - malloc(my_ntimers * sizeof(*my_timernames)); /* these arrays can be too large for the stack */ - assert(my_timernames); + /* (these arrays can be too large for the stack_ */ + timername_t *my_timernames = malloc(my_ntimers * sizeof *my_timernames); + assert(my_ntimers==0 || my_timernames); for (int n=0; nsecs_max[n] = maxval; } } - + free(all_timernames); free(my_timernames); -- cgit v1.2.3