diff options
author | Thomas White <taw@physics.org> | 2013-06-01 19:00:01 -0700 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2013-06-01 19:00:01 -0700 |
commit | 3104cf229230151e8ca158144952d474f4b61aa3 (patch) | |
tree | 265cf4fc702109fd3a2066fa306a8d12203a7340 /libcrystfel/src/cell-utils.c | |
parent | c3ce11bc291eb890ec0061892534802e75e3c2c1 (diff) |
Fix multiple small memory leaks
Diffstat (limited to 'libcrystfel/src/cell-utils.c')
-rw-r--r-- | libcrystfel/src/cell-utils.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libcrystfel/src/cell-utils.c b/libcrystfel/src/cell-utils.c index 8b881178..12443c8d 100644 --- a/libcrystfel/src/cell-utils.c +++ b/libcrystfel/src/cell-utils.c @@ -526,6 +526,9 @@ UnitCell *match_cell(UnitCell *cell_in, UnitCell *template_in, int verbose, &bsx, &bsy, &bsz, &csx, &csy, &csz) ) { ERROR("Couldn't get reciprocal cell for template.\n"); + cell_free(template); + cell_free(cell); + tfn_free(uncentering); return NULL; } @@ -545,6 +548,9 @@ UnitCell *match_cell(UnitCell *cell_in, UnitCell *template_in, int verbose, &bsx, &bsy, &bsz, &csx, &csy, &csz) ) { ERROR("Couldn't get reciprocal cell.\n"); + cell_free(template); + cell_free(cell); + tfn_free(uncentering); return NULL; } @@ -715,9 +721,14 @@ UnitCell *match_cell(UnitCell *cell_in, UnitCell *template_in, int verbose, cell_set_unique_axis(new_cell_trans, cell_get_unique_axis(template_in)); + cell_free(template); + tfn_free(uncentering); + return new_cell_trans; } else { + cell_free(template); + tfn_free(uncentering); return NULL; } } |