diff options
author | goodale <goodale@d60812e6-3970-4df4-986e-c251b06effeb> | 2004-09-14 19:42:20 +0000 |
---|---|---|
committer | goodale <goodale@d60812e6-3970-4df4-986e-c251b06effeb> | 2004-09-14 19:42:20 +0000 |
commit | 0204d02e92a7777fe3f70ea2cd68699ecc8059f6 (patch) | |
tree | 02e9fc0e4d2e32c663a5950df38127747e55a0cb | |
parent | 89958930ed923eab5af5b8178e47023001a972c9 (diff) |
Fix memory allocation error.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHReduce/trunk@52 d60812e6-3970-4df4-986e-c251b06effeb
-rw-r--r-- | src/ReduceGA.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ReduceGA.c b/src/ReduceGA.c index 52cfad3..e7f7181 100644 --- a/src/ReduceGA.c +++ b/src/ReduceGA.c @@ -149,15 +149,15 @@ static int ReduceGridArrays (const cGH *GH, /* allocate memory for type codes and input array pointer */ input_array_type_codes = (CCTK_INT *)malloc (N_input_arrays *sizeof(CCTK_INT)); input_arrays = (CCTK_POINTER) malloc (N_input_arrays *sizeof(CCTK_POINTER)); + + /* set the number of dimensions */ + dim = CCTK_GroupDimFromVarI(input_array_variable_indices[0]); /* allocate memory for the array of the dimensions of the input arrays */ lower_array_bounds = (CCTK_INT *)malloc (dim *sizeof(CCTK_INT)); upper_array_bounds = (CCTK_INT *)malloc (dim *sizeof(CCTK_INT)); input_array_dims = (CCTK_INT *)malloc (dim *sizeof(CCTK_INT)); - /* set the number of dimensions */ - dim = CCTK_GroupDimFromVarI(input_array_variable_indices[0]); - /* find out the types of the input arrays and put that */ /* in an array */ for ( i = 0; i < N_input_arrays; i++) |