summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5tools_utils.c
diff options
context:
space:
mode:
authorM. Scot Breitenfeld <brtnfld@hdfgroup.org>2019-03-07 20:47:38 (GMT)
committerM. Scot Breitenfeld <brtnfld@hdfgroup.org>2019-03-07 20:47:38 (GMT)
commit07fde1e25c51e1c4294248311104ef02dbb7da21 (patch)
treeeeeebf3da31ab3a47716759985c375203cf04976 /tools/lib/h5tools_utils.c
parent5a51c3677e25e8426d6cd8532baa46244d645cf9 (diff)
parent8d2a047c25d2bd34c52c8d437802c309a9ae0985 (diff)
downloadhdf5-07fde1e25c51e1c4294248311104ef02dbb7da21.zip
hdf5-07fde1e25c51e1c4294248311104ef02dbb7da21.tar.gz
hdf5-07fde1e25c51e1c4294248311104ef02dbb7da21.tar.bz2
Merge branch 'develop' into H10621
Diffstat (limited to 'tools/lib/h5tools_utils.c')
-rw-r--r--tools/lib/h5tools_utils.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c
index 8ac0d32..e7e017f 100644
--- a/tools/lib/h5tools_utils.c
+++ b/tools/lib/h5tools_utils.c
@@ -561,6 +561,8 @@ herr_t
init_objs(hid_t fid, find_objs_t *info, table_t **group_table,
table_t **dset_table, table_t **type_table)
{
+ herr_t ret_value = SUCCEED;
+
/* Initialize the tables */
init_table(group_table);
init_table(dset_table);
@@ -573,7 +575,20 @@ init_objs(hid_t fid, find_objs_t *info, table_t **group_table,
info->dset_table = *dset_table;
/* Find all shared objects */
- return(h5trav_visit(fid, "/", TRUE, TRUE, find_objs_cb, NULL, info, H5O_INFO_BASIC));
+ if((ret_value = h5trav_visit(fid, "/", TRUE, TRUE, find_objs_cb, NULL, info, H5O_INFO_BASIC)) < 0)
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "finding shared objects failed")
+
+done:
+ /* Release resources */
+ if(ret_value < 0) {
+ free_table(*group_table);
+ info->group_table = NULL;
+ free_table(*type_table);
+ info->type_table = NULL;
+ free_table(*dset_table);
+ info->dset_table = NULL;
+ }
+ return ret_value;
}