summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2019-06-11 11:09:27 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2019-06-11 11:09:27 (GMT)
commit5098894ffde76620db2798fba900287aaf518166 (patch)
treede9ee4dae26f42289b70d521470ba784fc06317a
parent48b0ff7724331737140ffae194cb2e741f0b668d (diff)
downloadhdf5-5098894ffde76620db2798fba900287aaf518166.zip
hdf5-5098894ffde76620db2798fba900287aaf518166.tar.gz
hdf5-5098894ffde76620db2798fba900287aaf518166.tar.bz2
Fixed a memory issue where unfreed shared attribute dataspace memory
tripped an assert in our memory sanity checks. Fixes HDFFV-10774.
-rw-r--r--src/H5Oattr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index 0a7c4bf..f9c5fcf 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -200,7 +200,7 @@ H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
* What's actually shared, though, is only the extent.
*/
if(NULL == (attr->shared->ds = H5FL_CALLOC(H5S_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Decode attribute's dataspace extent */
if((extent = (H5S_extent_t *)(H5O_MSG_SDSPACE->decode)(f, open_oh,
@@ -253,6 +253,8 @@ H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
done:
if(NULL == ret_value)
if(attr) {
+ if(attr->shared->ds)
+ attr->shared->ds = H5FL_FREE(H5S_t, attr->shared->ds);
if(attr->shared) {
/* Free any dynamically allocated items */
if(H5A__free(attr) < 0)