aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2013-06-01 15:41:37 -0700
committerThomas White <taw@physics.org>2013-06-01 15:41:37 -0700
commit3f56c4a884d404230dc31701d3b8abe5206c63d6 (patch)
tree54dc0903596da18bfe80625ab290a385b34a0d8f /libcrystfel
parentd1a49592c0a96e12709c80cebd44a2528bafff9a (diff)
Fix memory leaks
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/integration.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libcrystfel/src/integration.c b/libcrystfel/src/integration.c
index 3a3c9629..91f9ab21 100644
--- a/libcrystfel/src/integration.c
+++ b/libcrystfel/src/integration.c
@@ -561,7 +561,11 @@ static void free_intcontext(struct intcontext *ic)
{
int i;
+ for ( i=0; i<ic->n_boxes; i++ ) {
+ free(ic->boxes[i].bm);
+ }
free(ic->boxes);
+
for ( i=0; i<ic->n_reference_profiles; i++ ) {
free(ic->reference_profiles[i]);
free(ic->reference_den[i]);
@@ -663,6 +667,8 @@ static void delete_box(struct intcontext *ic, struct peak_box *bx)
return;
}
+ free(bx->bm);
+
memmove(&ic->boxes[i], &ic->boxes[i+1],
(ic->n_boxes-i-1)*sizeof(struct peak_box));
ic->n_boxes--;
@@ -941,6 +947,7 @@ static int center_and_check_box(struct intcontext *ic, struct peak_box *bx,
t_offs_fs += rint(offs_fs);
t_offs_ss += rint(offs_fs);
+ free(bx->bm);
if ( check_box(ic, bx, sat) ) return 1;
if ( t_offs_fs*t_offs_fs + t_offs_ss*t_offs_ss > ic->w*ic->w ) {