From 21ec571897192fef72050eda2527b5ef4e7f5fa7 Mon Sep 17 00:00:00 2001 From: Yaroslav Gevorkov Date: Mon, 22 Oct 2018 14:17:31 +0200 Subject: fix freeing unallocated memory --- libcrystfel/src/xgandalf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libcrystfel') diff --git a/libcrystfel/src/xgandalf.c b/libcrystfel/src/xgandalf.c index a83f0524..2434ce2e 100644 --- a/libcrystfel/src/xgandalf.c +++ b/libcrystfel/src/xgandalf.c @@ -147,6 +147,7 @@ void *xgandalf_prepare(IndexingMethod *indm, UnitCell *cell, allocReciprocalPeaks(&(xgandalf_private_data->reciprocalPeaks_1_per_A)); xgandalf_private_data->indm = *indm; xgandalf_private_data->cellTemplate = NULL; + xgandalf_private_data->uncenteringTransformation = NULL; float tolerance = xgandalf_opts->tolerance; samplingPitch_t samplingPitch = xgandalf_opts->sampling_pitch; @@ -249,7 +250,9 @@ void xgandalf_cleanup(void *pp) freeReciprocalPeaks(xgandalf_private_data->reciprocalPeaks_1_per_A); IndexerPlain_delete(xgandalf_private_data->indexer); - tfn_free(xgandalf_private_data->uncenteringTransformation); + if(xgandalf_private_data->uncenteringTransformation != NULL){ + tfn_free(xgandalf_private_data->uncenteringTransformation); + } } static void reduceCell(UnitCell *cell, LatticeTransform_t* appliedReductionTransform) -- cgit v1.2.3