aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/index.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-09-03 15:27:15 +0200
committerThomas White <taw@physics.org>2019-09-03 15:29:34 +0200
commit628e263dce6ca70b06c60904d4de568b87a833f7 (patch)
treea8ba60d6bf01b60f5ec4cc25950cea3dfef34ae7 /libcrystfel/src/index.c
parentedf2e9869600d1779383317f4b2f661faff9a0e3 (diff)
Fix memory leaks in cell comparison
Diffstat (limited to 'libcrystfel/src/index.c')
-rw-r--r--libcrystfel/src/index.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c
index af4385cd..36d7b84b 100644
--- a/libcrystfel/src/index.c
+++ b/libcrystfel/src/index.c
@@ -539,10 +539,10 @@ static int check_cell(IndexingFlags flags, Crystal *cr, UnitCell *target,
/* Check at all? */
if ( !(flags & INDEXING_CHECK_CELL) ) return 0;
- if ( compare_reindexed_cell_parameters(crystal_get_cell(cr), target,
- tolerance, &rm) )
- {
- out = cell_transform_rational(crystal_get_cell(cr), rm);
+ out = compare_reindexed_cell_parameters(crystal_get_cell(cr), target,
+ tolerance, &rm);
+
+ if ( out != NULL ) {
cell_free(crystal_get_cell(cr));
crystal_set_cell(cr, out);
rtnl_mtx_free(rm);