From 0204d02e92a7777fe3f70ea2cd68699ecc8059f6 Mon Sep 17 00:00:00 2001 From: goodale Date: Tue, 14 Sep 2004 19:42:20 +0000 Subject: Fix memory allocation error. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHReduce/trunk@52 d60812e6-3970-4df4-986e-c251b06effeb --- src/ReduceGA.c | 6 +++--- 1 file 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++) -- cgit v1.2.3