aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@b32723a9-ab3a-4a60-88e2-2e5d99d7c17a>2003-10-27 13:23:39 +0000
committertradke <tradke@b32723a9-ab3a-4a60-88e2-2e5d99d7c17a>2003-10-27 13:23:39 +0000
commitff02a695ef98e2adb25775c1d7054db32ea67913 (patch)
tree3ff2602965966e7fd38e2f7fa9c6b2e3ca51c7f0
parentd7f8062b0c44c901d12ab8500d2a485fe9e37c76 (diff)
Don't call CCTK_GroupgshVI() on grid scalar variables.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOUtil/trunk@194 b32723a9-ab3a-4a60-88e2-2e5d99d7c17a
-rw-r--r--src/Utils.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/Utils.c b/src/Utils.c
index 4870d61..e3b0274 100644
--- a/src/Utils.c
+++ b/src/Utils.c
@@ -951,8 +951,12 @@ ioRequest *IOUtil_DefaultIORequest (const cGH *GH, int vindex,
/* get the variable's dimension and extents */
request->vdim = CCTK_GroupDimFromVarI (vindex);
- extent_int = malloc (request->vdim * sizeof (int));
- CCTK_GroupgshVI (GH, request->vdim, extent_int, vindex);
+ extent_int = NULL;
+ if (request->vdim > 0)
+ {
+ extent_int = malloc (request->vdim * sizeof (int));
+ CCTK_GroupgshVI (GH, request->vdim, extent_int, vindex);
+ }
/* allocate the arrays all in one go
only initialize those which are mandatory for the Hyperslab API */
@@ -991,7 +995,10 @@ ioRequest *IOUtil_DefaultIORequest (const cGH *GH, int vindex,
}
/* clean up */
- free (extent_int);
+ if (extent_int)
+ {
+ free (extent_int);
+ }
return (request);
}