aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2013-03-05 10:13:19 +0100
committerThomas White <taw@physics.org>2013-03-05 10:13:19 +0100
commitc4b0c24e9ea9ced7513d67f1a69893f804e12051 (patch)
tree76a67cde16dde159d53660ef1fcf04b207b29e6e
parent02da19328000e01b78249cfe88ed4ab9cdd55fcd (diff)
tests/pr_gradient_check: Fix memory bugs
-rw-r--r--tests/pr_gradient_check.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/pr_gradient_check.c b/tests/pr_gradient_check.c
index 9d713e0b..48b29866 100644
--- a/tests/pr_gradient_check.c
+++ b/tests/pr_gradient_check.c
@@ -128,7 +128,7 @@ static Crystal *new_shifted_crystal(Crystal *cr, int refine, double incr_val)
double r;
UnitCell *cell;
- cr_new = crystal_new();
+ cr_new = crystal_copy(cr);
if ( cr_new == NULL ) {
ERROR("Failed to allocate crystal.\n");
return NULL;
@@ -192,7 +192,7 @@ static void calc_either_side(Crystal *cr, double incr_val,
compare = find_intersections(image, cr_new);
scan_partialities(crystal_get_reflections(cr), compare, valid,
- vals, 0);
+ vals, 2);
cell_free(crystal_get_cell(cr_new));
crystal_free(cr_new);
reflist_free(compare);