aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaroslav Gevorkov <yaroslav.gevorkov@desy.de>2018-10-22 14:17:31 +0200
committerThomas White <taw@physics.org>2018-10-22 14:40:15 +0200
commit21ec571897192fef72050eda2527b5ef4e7f5fa7 (patch)
tree38a1600a71f8b79a02f66f12d91787e6d85f8a5b
parentf863d8e973585d6afd65adf69347a0326afe5e8a (diff)
fix freeing unallocated memory
-rw-r--r--libcrystfel/src/xgandalf.c5
1 files changed, 4 insertions, 1 deletions
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)