From c4b0c24e9ea9ced7513d67f1a69893f804e12051 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 5 Mar 2013 10:13:19 +0100 Subject: tests/pr_gradient_check: Fix memory bugs --- tests/pr_gradient_check.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/pr_gradient_check.c') 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); -- cgit v1.2.3