aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2012-02-21 17:16:07 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:45 +0100
commit75a5b1a7edf3904f09bf1765fc762c5cc478d1e6 (patch)
treed089c11b67afeeda3b611c6f6988fcd58c8ffa92 /libcrystfel
parentbdbc9bfa11c862bc1eb72785cab512845bc2818d (diff)
Fix some memory leaks
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/detector.c4
-rw-r--r--libcrystfel/src/reax.c8
2 files changed, 11 insertions, 1 deletions
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; i<det->n_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);