Commit 8ac49af1 authored by Thomas White's avatar Thomas White
Browse files

Fix memory leaks

parent b8ac0fae
......@@ -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);
......
......@@ -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 ) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment