diff options
author | Thomas White <taw@physics.org> | 2015-06-25 12:13:49 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2015-06-25 12:14:43 +0200 |
commit | 330fff9a164acc19d23dda7c65300bf927eed41e (patch) | |
tree | d3d10d47cfa8e2c65d05c5d90daec7be2cbd00a5 | |
parent | bfb2044c589bbc5dcf94450cbaca1acbef1033ea (diff) |
Tidy up some small leaks and memory bugs
-rw-r--r-- | libcrystfel/src/cell-utils.c | 2 | ||||
-rw-r--r-- | libcrystfel/src/detector.c | 7 | ||||
-rw-r--r-- | libcrystfel/src/index.c | 3 | ||||
-rw-r--r-- | src/im-sandbox.c | 2 | ||||
-rw-r--r-- | src/indexamajig.c | 4 |
5 files changed, 10 insertions, 8 deletions
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; i<in->n_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); } diff --git a/src/im-sandbox.c b/src/im-sandbox.c index bef1bf56..36150a1b 100644 --- a/src/im-sandbox.c +++ b/src/im-sandbox.c @@ -521,8 +521,6 @@ static void run_work(const struct index_args *iargs, free(bd.rbuffer); cleanup_indexing(iargs->indm, iargs->ipriv); - free(iargs->indm); - free(iargs->ipriv); free_detector_geometry(iargs->det); free(iargs->hdf5_peak_path); free_copy_hdf5_field_list(iargs->copyme); diff --git a/src/indexamajig.c b/src/indexamajig.c index c7e4a270..deac67bf 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -724,9 +724,13 @@ int main(int argc, char *argv[]) create_sandbox(&iargs, n_proc, prefix, config_basename, fh, st, tempdir); + free_copy_hdf5_field_list(iargs.copyme); + cell_free(iargs.cell); + free(iargs.beam->photon_energy_from); free(prefix); free(tempdir); free_detector_geometry(iargs.det); + free(iargs.hdf5_peak_path); close_stream(st); cleanup_indexing(indm, ipriv); |