summaryrefslogtreecommitdiffstats
path: root/src/H5Rint.c
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2020-03-16 19:06:57 (GMT)
committervchoi <vchoi@jelly.ad.hdfgroup.org>2020-03-16 19:33:52 (GMT)
commit3b2db5eb19594fa44357e63e36f3b294fbae463d (patch)
tree10bf21ba25e395c1a985a5ff333a79da9541d65b /src/H5Rint.c
parentfbda71a49e85648fcf45b491b5eebea74d4e5941 (diff)
downloadhdf5-3b2db5eb19594fa44357e63e36f3b294fbae463d.zip
hdf5-3b2db5eb19594fa44357e63e36f3b294fbae463d.tar.gz
hdf5-3b2db5eb19594fa44357e63e36f3b294fbae463d.tar.bz2
Merge pull request #2451 in HDFFV/hdf5 from ~VCHOI/my_third_fork:bugfix/develop_seg_fault_sel_compat to develop
* commit '81b1ed4e1724b8a6a731ab2b8fb03234a8b49d15': Fix issues when deserializing point/all/none selection with version beyond the library's supported version: (1) Verify the decoded version before proceeding further with deserialization (2) Close the dataspace if errors occurred after opening the dataspace
Diffstat (limited to 'src/H5Rint.c')
-rw-r--r--src/H5Rint.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/H5Rint.c b/src/H5Rint.c
index 486c1ff..131336b 100644
--- a/src/H5Rint.c
+++ b/src/H5Rint.c
@@ -1768,6 +1768,7 @@ H5R__decode_token_region_compat(H5F_t *f, const unsigned char *buf,
H5O_token_t token = { 0 };
size_t data_size;
const uint8_t *p;
+ H5S_t *space = NULL;
herr_t ret_value = SUCCEED;
FUNC_ENTER_PACKAGE
@@ -1788,7 +1789,6 @@ H5R__decode_token_region_compat(H5F_t *f, const unsigned char *buf,
if(space_ptr) {
H5O_loc_t oloc; /* Object location */
- H5S_t *space = NULL;
/* Initialize the object location */
H5O_loc_reset(&oloc);
@@ -1812,6 +1812,12 @@ H5R__decode_token_region_compat(H5F_t *f, const unsigned char *buf,
done:
H5MM_free(data);
+
+ if(ret_value < 0) {
+ if(space && H5S_close(space) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace")
+ }
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5R__decode_token_region_compat() */