summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-04-14 17:32:20 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-04-14 17:32:20 (GMT)
commit7ada17fa2e3d1df0d3df44b0713d0de40194777f (patch)
treebcaf1436b5920833e0ae602dabc627e1d11a1eac
parent0d5c94ab371e949751431095cdf5f608471d1fc7 (diff)
parentf4324635e142eacf7c4a72224038152ea73d1139 (diff)
downloadhdf5-7ada17fa2e3d1df0d3df44b0713d0de40194777f.zip
hdf5-7ada17fa2e3d1df0d3df44b0713d0de40194777f.tar.gz
hdf5-7ada17fa2e3d1df0d3df44b0713d0de40194777f.tar.bz2
Merging in latest from upstream (HDFFV/hdf5:refs/heads/hdf5_1_10)
* commit 'f4324635e142eacf7c4a72224038152ea73d1139': A fix in the cleaning up code for datatype when datatype initialization via H5D__init_type() fails. The code to fix the problem is the same as what is done in H5D__open_oid().
-rw-r--r--src/H5Dint.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/H5Dint.c b/src/H5Dint.c
index 6b7cb2c..d838889 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -1327,7 +1327,7 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id,
ret_value = new_dset;
done:
- if(!ret_value && new_dset && new_dset->shared) {
+ if(!ret_value && new_dset) {
if(new_dset->shared) {
if(layout_init)
if(new_dset->shared->layout.ops->dest && (new_dset->shared->layout.ops->dest)(new_dset) < 0)
@@ -1346,8 +1346,16 @@ done:
HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, NULL, "unable to reset external file list info")
if(new_dset->shared->space && H5S_close(new_dset->shared->space) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release dataspace")
- if(new_dset->shared->type && H5I_dec_ref(new_dset->shared->type_id) < 0)
- HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release datatype")
+ if(new_dset->shared->type) {
+ if(new_dset->shared->type_id > 0) {
+ if(H5I_dec_ref(new_dset->shared->type_id) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release datatype")
+ } /* end if */
+ else {
+ if(H5T_close_real(new_dset->shared->type) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release datatype")
+ } /* end else */
+ } /* end if */
if(H5F_addr_defined(new_dset->oloc.addr)) {
if(H5O_dec_rc_by_loc(&(new_dset->oloc)) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement refcount on newly created object")