From 75a5b1a7edf3904f09bf1765fc762c5cc478d1e6 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 21 Feb 2012 17:16:07 +0100 Subject: Fix some memory leaks --- libcrystfel/src/detector.c | 4 ++++ libcrystfel/src/reax.c | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'libcrystfel') diff --git a/libcrystfel/src/detector.c b/libcrystfel/src/detector.c index 5b0bad41..91aa6c6e 100644 --- a/libcrystfel/src/detector.c +++ b/libcrystfel/src/detector.c @@ -943,6 +943,10 @@ void free_detector_geometry(struct detector *det) } free(det->rigid_groups); + for ( i=0; in_panels; i++ ) { + free(det->panels[i].clen_from); + } + free(det->panels); free(det->bad); free(det->mask); diff --git a/libcrystfel/src/reax.c b/libcrystfel/src/reax.c index 37e1ca05..d624e236 100644 --- a/libcrystfel/src/reax.c +++ b/libcrystfel/src/reax.c @@ -1013,7 +1013,11 @@ void reax_index(IndexingPrivate *pp, struct image *image, UnitCell *cell) pmax = max_feature_resolution(image->features); /* Sanity check */ - if ( pmax < 1e4 ) return; + if ( pmax < 1e4 ) { + fftw_free(fft_in); + fftw_free(fft_out); + return; + } s = search_all_axes(cell, pmax); find_candidates(p, image->features, pmax, fft_in, fft_out, s, @@ -1112,6 +1116,8 @@ void reax_cleanup(IndexingPrivate *pp) assert(pp->indm == INDEXING_REAX); p = (struct reax_private *)pp; + free(p->directions); + fftw_destroy_plan(p->plan); fftw_free(p->fft_in); fftw_free(p->fft_out); -- cgit v1.2.3