diff options
author | rideout <rideout@6a38eb6e-646e-4a02-a296-d141613ad6c4> | 2002-12-30 18:42:56 +0000 |
---|---|---|
committer | rideout <rideout@6a38eb6e-646e-4a02-a296-d141613ad6c4> | 2002-12-30 18:42:56 +0000 |
commit | ea76585f7d3b3942ee7e4f3c3d33356b1f35fdb5 (patch) | |
tree | fa5d71c6c2df3e66c24d7ceb049ff6ab3cf01e27 | |
parent | 197fd2f3168cf373af009aa48ac039f965b2f3e5 (diff) |
Only free temporary arrays in Boundary_ApplyPhysicalBCs() if they have
been allocated.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Boundary/trunk@188 6a38eb6e-646e-4a02-a296-d141613ad6c4
-rw-r--r-- | src/Boundary.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Boundary.c b/src/Boundary.c index 0907d91..f000108 100644 --- a/src/Boundary.c +++ b/src/Boundary.c @@ -768,6 +768,7 @@ void Boundary_ApplyPhysicalBCs(CCTK_ARGUMENTS) { struct BCDATA *current_bcdata; max_num_vars = 0; + vars = NULL; /* so that it won't be freed if it was never malloced */ /* Step through each requested physical boundary condition */ for (current_bcdata = bcdata_list; @@ -834,8 +835,11 @@ void Boundary_ApplyPhysicalBCs(CCTK_ARGUMENTS) { } /* Free data */ - free(vars); - free(tables); + if (vars) + { + free(vars); + free(tables); + } } /*@@ |