From 330fff9a164acc19d23dda7c65300bf927eed41e Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 25 Jun 2015 12:13:49 +0200 Subject: Tidy up some small leaks and memory bugs --- libcrystfel/src/cell-utils.c | 2 ++ libcrystfel/src/detector.c | 7 +------ libcrystfel/src/index.c | 3 +++ 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'libcrystfel/src') diff --git a/libcrystfel/src/cell-utils.c b/libcrystfel/src/cell-utils.c index 764646dd..3b3c5fe3 100644 --- a/libcrystfel/src/cell-utils.c +++ b/libcrystfel/src/cell-utils.c @@ -1348,6 +1348,8 @@ UnitCell *load_cell_from_file(const char *filename) } while ( rval != NULL ); + fclose(fh); + if ( have_a && have_b && have_c && have_al && have_be && have_ga ) { cell_set_parameters(cell, a, b, c, al, be, ga); } diff --git a/libcrystfel/src/detector.c b/libcrystfel/src/detector.c index 41b63997..9bbd4208 100644 --- a/libcrystfel/src/detector.c +++ b/libcrystfel/src/detector.c @@ -1631,6 +1631,7 @@ out: add_to_rigid_group_coll(rgcollection, r); free(bits[rgi]); } + free(bits); free(rgc_defl[rgci]->name); free(rgc_defl[rgci]->rgs); free(rgc_defl[rgci]); @@ -1773,12 +1774,6 @@ struct detector *copy_geom(const struct detector *in) } - if ( p->clen_from != NULL ) { - /* Make a copy of the mask fields unique to this - * copy of the structure. */ - p->clen_from = strdup(p->clen_from); - } - } for ( i=0; in_panels; i++ ) { diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c index c3aef88e..2512414d 100644 --- a/libcrystfel/src/index.c +++ b/libcrystfel/src/index.c @@ -186,6 +186,9 @@ void cleanup_indexing(IndexingMethod *indms, IndexingPrivate **privs) n++; } + + free(indms); + free(privs); } -- cgit v1.2.3