summaryrefslogtreecommitdiffstats
path: root/src/H5Rint.c
diff options
context:
space:
mode:
authorJerome Soumagne <jsoumagne@hdfgroup.org>2019-11-26 21:50:08 (GMT)
committerJerome Soumagne <jsoumagne@hdfgroup.org>2019-11-26 21:50:08 (GMT)
commit6b68cc352ffabb5fe997db1eb52216b3ee80e669 (patch)
treeff141b2b504db24deab1799be4a548d8fc660c1f /src/H5Rint.c
parentb8a56718e40efaf6954a760984b9d513dbff8f7d (diff)
downloadhdf5-6b68cc352ffabb5fe997db1eb52216b3ee80e669.zip
hdf5-6b68cc352ffabb5fe997db1eb52216b3ee80e669.tar.gz
hdf5-6b68cc352ffabb5fe997db1eb52216b3ee80e669.tar.bz2
H5R: fix H5Tconv to check for null references
Valid for both deprecated and non-deprecated references Update test
Diffstat (limited to 'src/H5Rint.c')
-rw-r--r--src/H5Rint.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/H5Rint.c b/src/H5Rint.c
index 504ae06..0879f31 100644
--- a/src/H5Rint.c
+++ b/src/H5Rint.c
@@ -413,6 +413,7 @@ H5R__destroy(H5R_ref_priv_t *ref)
break;
case H5R_OBJECT1:
case H5R_DATASET_REGION1:
+ break;
case H5R_BADTYPE:
case H5R_MAXTYPE:
HDassert("invalid reference type" && 0);
@@ -423,7 +424,7 @@ H5R__destroy(H5R_ref_priv_t *ref)
} /* end switch */
/* Decrement refcount of attached loc_id */
- if((ref->loc_id != H5I_INVALID_HID) && (H5I_dec_ref(ref->loc_id) < 0))
+ if(ref->type && (ref->loc_id != H5I_INVALID_HID) && (H5I_dec_ref(ref->loc_id) < 0))
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDEC, FAIL, "decrementing location ID failed")
done: