aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschnetter <schnetter@b61c5cb5-eaca-4651-9a7a-d64986f99364>2008-03-20 00:24:54 +0000
committerschnetter <schnetter@b61c5cb5-eaca-4651-9a7a-d64986f99364>2008-03-20 00:24:54 +0000
commitdecbf2ba39df801694fbb27a70b2987dbcf094c8 (patch)
tree55496bab27557579bd561d662d3a7616c83499bb
parentac0441559f03fa142c708a7ccac8024817de9781 (diff)
Correct error in error checking: malloc can return NULL if 0 bytes are
allocated. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@489 b61c5cb5-eaca-4651-9a7a-d64986f99364
-rw-r--r--src/Storage.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Storage.c b/src/Storage.c
index c73e42f..eba35f1 100644
--- a/src/Storage.c
+++ b/src/Storage.c
@@ -642,7 +642,8 @@ static int PUGH_EnableGArrayGroupStorage (pGH *pughGH,
(size_t) GA->extras->npoints * GA->varsize
* GA->vector_size, &GA->padddata);
}
- if (!GA->data)
+ if (GA->extras->npoints * GA->varsize * GA->vector_size > 0 &&
+ GA->padddata == NULL)
{
CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING, "Error allocating memory "
"block of size %.0f",