From 8ac49af1e7435f75345ec82ba10e1bf416853cb0 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 15 Mar 2011 17:32:09 +0100 Subject: Fix memory leaks --- src/process_hkl.c | 1 + src/stream.c | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'src') diff --git a/src/process_hkl.c b/src/process_hkl.c index da3ee3f8..3e2a4900 100644 --- a/src/process_hkl.c +++ b/src/process_hkl.c @@ -316,6 +316,7 @@ static void merge_all(FILE *fh, RefList *model, } + free(image.filename); reflist_free(image.reflections); image_feature_list_free(image.features); cell_free(image.indexed_cell); diff --git a/src/stream.c b/src/stream.c index 4b2bea9f..260504da 100644 --- a/src/stream.c +++ b/src/stream.c @@ -397,8 +397,13 @@ int read_chunk(FILE *fh, struct image *image) } if ( have_as && have_bs && have_cs ) { + if ( image->indexed_cell != NULL ) { + ERROR("Duplicate cell found in stream!\n"); + cell_free(image->indexed_cell); + } image->indexed_cell = cell_new_from_axes(as, bs, cs); have_cell = 1; + have_as = 0; have_bs = 0; have_cs = 0; } if ( strncmp(line, "photon_energy_eV = ", 19) == 0 ) { -- cgit v1.2.3