diff options
author | Thomas White <taw@physics.org> | 2013-06-01 15:41:37 -0700 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2013-06-01 15:41:37 -0700 |
commit | 3f56c4a884d404230dc31701d3b8abe5206c63d6 (patch) | |
tree | 54dc0903596da18bfe80625ab290a385b34a0d8f | |
parent | d1a49592c0a96e12709c80cebd44a2528bafff9a (diff) |
Fix memory leaks
-rw-r--r-- | libcrystfel/src/integration.c | 7 | ||||
-rw-r--r-- | src/indexamajig.c | 1 | ||||
-rw-r--r-- | src/process_image.c | 2 |
3 files changed, 10 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 ) { diff --git a/src/indexamajig.c b/src/indexamajig.c index 27ea8fa5..0431d2bb 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -562,6 +562,7 @@ int main(int argc, char *argv[]) use_this_one_instead, ofd, argc, argv); free(prefix); + free(iargs.det); return 0; } diff --git a/src/process_image.c b/src/process_image.c index c7636560..898e653f 100644 --- a/src/process_image.c +++ b/src/process_image.c @@ -189,6 +189,8 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs, free(image.dp[i]); free(image.bad[i]); } + free(image.dp); + free(image.bad); free(image.data); if ( image.flags != NULL ) free(image.flags); |