From 2ef84f8419beee133ba72d7c74966b83d3e6471d Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 28 Feb 2019 15:58:25 +0100 Subject: partialator: Avoid double-free of stuff_from_stream and filename --- src/partialator.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/partialator.c b/src/partialator.c index 50518b99..9de5276f 100644 --- a/src/partialator.c +++ b/src/partialator.c @@ -1345,6 +1345,9 @@ int main(int argc, char *argv[]) return 1; } + free_stuff_from_stream(cur.stuff_from_stream); + cur.stuff_from_stream = NULL; + for ( i=0; in_crystals = 1; image->crystals = &crystals[n_crystals]; - free(cur.crystals); + + image->filename = strdup(image->filename); /* This is the raw list of reflections */ cr_refl = crystal_get_reflections(cr); @@ -1408,6 +1412,8 @@ int main(int argc, char *argv[]) if ( n_crystals == stop_after ) break; } + free(cur.crystals); + free(cur.filename); n_images++; @@ -1575,7 +1581,6 @@ int main(int argc, char *argv[]) for ( i=0; istuff_from_stream); free(image->filename); free(image); cell_free(crystal_get_cell(crystals[i])); -- cgit v1.2.3