From 1bad219c3b968142fdeb686bad04b4b706c4368f Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 14 Nov 2011 15:29:07 +0100 Subject: Free "copy HDF5 field" list --- src/hdf5-file.c | 11 +++++++++++ src/hdf5-file.h | 1 + src/indexamajig.c | 1 + 3 files changed, 13 insertions(+) diff --git a/src/hdf5-file.c b/src/hdf5-file.c index 6215cc5c..355e97f1 100644 --- a/src/hdf5-file.c +++ b/src/hdf5-file.c @@ -565,6 +565,17 @@ struct copy_hdf5_field *new_copy_hdf5_field_list() } +void free_copy_hdf5_field_list(struct copy_hdf5_field *n) +{ + int i; + for ( i=0; in_fields; i++ ) { + free(n->fields[i]); + } + free(n->fields); + free(n); +} + + void add_copy_hdf5_field(struct copy_hdf5_field *copyme, const char *name) { diff --git a/src/hdf5-file.h b/src/hdf5-file.h index 811bfb1f..385e919c 100644 --- a/src/hdf5-file.h +++ b/src/hdf5-file.h @@ -45,6 +45,7 @@ extern int get_peaks(struct image *image, struct hdfile *f, const char *p); extern double get_value(struct hdfile *f, const char *name); extern struct copy_hdf5_field *new_copy_hdf5_field_list(void); +extern void free_copy_hdf5_field_list(struct copy_hdf5_field *f); extern void copy_hdf5_fields(struct hdfile *f, const struct copy_hdf5_field *copyme, FILE *fh); extern void add_copy_hdf5_field(struct copy_hdf5_field *copyme, diff --git a/src/indexamajig.c b/src/indexamajig.c index e78eff02..e7391bb5 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -951,6 +951,7 @@ int main(int argc, char *argv[]) free(beam); free(element); free(hdf5_peak_path); + free_copy_hdf5_field_list(copyme); cell_free(cell); if ( fh != stdin ) fclose(fh); if ( ofh != stdout ) fclose(ofh); -- cgit v1.2.3