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/reax.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libcrystfel/src/reax.c') 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