diff options
author | Thomas White <taw@physics.org> | 2019-01-25 09:31:34 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2019-01-28 14:55:31 +0100 |
commit | 9b1d07ba6ed79d2b32b1e8fa92bd93628f66b1c0 (patch) | |
tree | 12f43425f32555c4c0145b5fba1465302d2398d3 /src/partialator.c | |
parent | 9d7a9223c780ff9ce75fa4ccac2321a011ae640b (diff) |
partialator: Fix multiple memory leaks
Diffstat (limited to 'src/partialator.c')
-rw-r--r-- | src/partialator.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/partialator.c b/src/partialator.c index aacf241f..8b4893a5 100644 --- a/src/partialator.c +++ b/src/partialator.c @@ -1237,6 +1237,7 @@ int main(int argc, char *argv[]) ERROR("Unknown partiality model '%s'.\n", pmodel_str); return 1; } + free(pmodel_str); } if ( (pmodel == PMODEL_UNITY) && !no_pr ) { @@ -1377,6 +1378,7 @@ int main(int argc, char *argv[]) *image = cur; image->n_crystals = 1; image->crystals = &crystals[n_crystals]; + free(cur.crystals); /* This is the raw list of reflections */ cr_refl = crystal_get_reflections(cr); @@ -1420,6 +1422,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "\n"); if ( sparams_fh != NULL ) fclose(sparams_fh); audit_info = stream_audit_info(st); + free(audit_info); close_stream(st); STATUS("Initial partiality calculation...\n"); @@ -1568,7 +1571,12 @@ int main(int argc, char *argv[]) /* Clean up */ gsl_rng_free(rng); for ( i=0; i<n_crystals; i++ ) { + struct image *image = crystal_get_image(crystals[i]); reflist_free(crystal_get_reflections(crystals[i])); + free_stuff_from_stream(image->stuff_from_stream); + free(image->filename); + free(image); + cell_free(crystal_get_cell(crystals[i])); crystal_free(crystals[i]); } free_contribs(full); |