diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2017-10-12 19:27:38 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2017-10-12 19:46:45 (GMT) |
commit | fc12672cdbd162f47293ec9ee2185e3efe1d0405 (patch) | |
tree | d8e29e80c6a995d1fc287a872fb82bbe91dc26b5 /tools/src | |
parent | 087e0d6efa0fdc9e9656d61f5dc2efd62b169e07 (diff) | |
download | hdf5-fc12672cdbd162f47293ec9ee2185e3efe1d0405.zip hdf5-fc12672cdbd162f47293ec9ee2185e3efe1d0405.tar.gz hdf5-fc12672cdbd162f47293ec9ee2185e3efe1d0405.tar.bz2 |
Close ids in loop
Diffstat (limited to 'tools/src')
-rw-r--r-- | tools/src/h5repack/h5repack.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index 6b8cf8a..2db7fdd 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -481,6 +481,19 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, if (options->verbose) printf(FORMAT_OBJ_ATTR, "attr", name); + + /*------------------------------------------------------------------------- + * close + *------------------------------------------------------------------------- + */ + if (H5Tclose(ftype_id) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); + if (H5Tclose(wtype_id) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); + if (H5Sclose(space_id) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); + if (H5Aclose(attr_id) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose failed"); } /* u */ done: @@ -792,9 +805,9 @@ static int check_objects(const char* fname, pack_opt_t *options) { done: H5E_BEGIN_TRY { - H5Fclose(fid); - H5Sclose(sid); H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid); } H5E_END_TRY; if (travt) trav_table_free(travt); |