From 5118da14ff063fec23240b116b0fed15a07d5c67 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 6 Apr 2010 17:47:28 +0200 Subject: Clean up HDF5 groups on the stack --- src/hdf5-file.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/hdf5-file.c') diff --git a/src/hdf5-file.c b/src/hdf5-file.c index c2f002ae..cb24fa48 100644 --- a/src/hdf5-file.c +++ b/src/hdf5-file.c @@ -100,14 +100,10 @@ int hdfile_get_height(struct hdfile *f) static void cleanup(hid_t fh) { - int n_objs, n_ids, i; - hid_t *ids; + int n_ids, i; + hid_t ids[256]; - n_objs = H5Fget_obj_count(fh, H5F_OBJ_ALL); - if ( n_objs <= 0 ) return; - - ids = malloc(n_objs * sizeof(hid_t)); - n_ids = H5Fget_obj_ids(fh, H5F_OBJ_ALL, n_objs, ids); + n_ids = H5Fget_obj_ids(fh, H5F_OBJ_ALL, 256, ids); for ( i=0; i