aboutsummaryrefslogtreecommitdiff
path: root/src/stream.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-03-15 17:32:09 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:20 +0100
commit8ac49af1e7435f75345ec82ba10e1bf416853cb0 (patch)
tree4f83f7a4a5aefc1d07b28a3b02c8e2d996b481c4 /src/stream.c
parentb8ac0faea1abb2e3033140dcd157160bfa98d251 (diff)
Fix memory leaks
Diffstat (limited to 'src/stream.c')
-rw-r--r--src/stream.c5
1 files changed, 5 insertions, 0 deletions
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 ) {