diff options
author | Thomas White <taw@physics.org> | 2011-11-14 15:29:07 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:39 +0100 |
commit | 1bad219c3b968142fdeb686bad04b4b706c4368f (patch) | |
tree | 3d6d9d409df627da9f7de5db8e8f9b6b59420456 /src | |
parent | 42e6b6387fc6e166bd493360ec89dda83ed9c2c6 (diff) |
Free "copy HDF5 field" list
Diffstat (limited to 'src')
-rw-r--r-- | src/hdf5-file.c | 11 | ||||
-rw-r--r-- | src/hdf5-file.h | 1 | ||||
-rw-r--r-- | src/indexamajig.c | 1 |
3 files changed, 13 insertions, 0 deletions
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; i<n->n_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); |