diff options
author | knarf <knarf@b2a53a04-0f4f-0410-87ed-f9f25ced00cf> | 2004-10-07 12:20:33 +0000 |
---|---|---|
committer | knarf <knarf@b2a53a04-0f4f-0410-87ed-f9f25ced00cf> | 2004-10-07 12:20:33 +0000 |
commit | 56edb0f45bea22c4405509665b921476d6461dda (patch) | |
tree | 30349c43dbccedb55d7d73cc36a4f70de26e7565 /src/FuncAndJacobian.c | |
parent | 5193ed91db2c3d10b45f56b156b7efe6773e4a3c (diff) |
- fix a segfault without sources
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinInitialData/TwoPunctures/trunk@23 b2a53a04-0f4f-0410-87ed-f9f25ced00cf
Diffstat (limited to 'src/FuncAndJacobian.c')
-rw-r--r-- | src/FuncAndJacobian.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/FuncAndJacobian.c b/src/FuncAndJacobian.c index a90c6be..4f0d13c 100644 --- a/src/FuncAndJacobian.c +++ b/src/FuncAndJacobian.c @@ -205,6 +205,7 @@ F_of_v (CCTK_POINTER_TO_CONST cctkGH, values = dvector (0, nvar - 1); allocate_derivs (&U, nvar); + sources=calloc(n1*n2*n3, sizeof(CCTK_REAL)); if (par_use_sources) { CCTK_REAL *s_x, *s_y, *s_z; @@ -212,7 +213,6 @@ F_of_v (CCTK_POINTER_TO_CONST cctkGH, s_x =calloc(n1*n2*n3, sizeof(CCTK_REAL)); s_y =calloc(n1*n2*n3, sizeof(CCTK_REAL)); s_z =calloc(n1*n2*n3, sizeof(CCTK_REAL)); - sources=calloc(n1*n2*n3, sizeof(CCTK_REAL)); for (i = 0; i < n1; i++) for (j = 0; j < n2; j++) for (k = 0; k < n3; k++) @@ -320,8 +320,7 @@ F_of_v (CCTK_POINTER_TO_CONST cctkGH, } } } - if (par_use_sources) - free(sources); + free(sources); free_dvector (values, 0, nvar - 1); free_derivs (&U, nvar); } |