diff options
author | Larry Knox <lrknox@hdfgroup.org> | 2019-02-28 20:29:04 (GMT) |
---|---|---|
committer | Larry Knox <lrknox@hdfgroup.org> | 2019-02-28 20:29:04 (GMT) |
commit | 7f797174c7a013359e94d1aa5d6540a5629aa550 (patch) | |
tree | 0320bfdb5418ab23978afbb1777539270f04c1f2 /tools/lib/h5tools_utils.c | |
parent | 5eef94f83f4875b64ffe7f9cea05d965bddbd802 (diff) | |
parent | 7eb65dbad45f473a953db595147b88d03f671658 (diff) | |
download | hdf5-7f797174c7a013359e94d1aa5d6540a5629aa550.zip hdf5-7f797174c7a013359e94d1aa5d6540a5629aa550.tar.gz hdf5-7f797174c7a013359e94d1aa5d6540a5629aa550.tar.bz2 |
Merge branch 'hdf5_1_10_5' into 1.10/master
Diffstat (limited to 'tools/lib/h5tools_utils.c')
-rw-r--r-- | tools/lib/h5tools_utils.c | 17 |
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; } |