summaryrefslogtreecommitdiffstats
path: root/src/H5Oattr.c
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 17:59:41 (GMT)
commitc4ee9ef7c05ce79e4503c1e5b3edfe8f912de60e (patch)
treefd0a24c6b63f7cc2ae8cd72675d062c540a3630c /src/H5Oattr.c
parent48b0ff7724331737140ffae194cb2e741f0b668d (diff)
downloadhdf5-c4ee9ef7c05ce79e4503c1e5b3edfe8f912de60e.zip
hdf5-c4ee9ef7c05ce79e4503c1e5b3edfe8f912de60e.tar.gz
hdf5-c4ee9ef7c05ce79e4503c1e5b3edfe8f912de60e.tar.bz2
Fixed a memory issue where unfreed shared attribute dataspace memory
tripped an assert in our memory sanity checks. Fixes HDFFV-10774.
Diffstat (limited to 'src/H5Oattr.c')
-rw-r--r--src/H5Oattr.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index 0a7c4bf..653c23a 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,14 +253,9 @@ 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) {
- /* Free any dynamically allocated items */
- if(H5A__free(attr) < 0)
- HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, NULL, "can't release attribute info")
-
- /* Destroy shared attribute struct */
- attr->shared = H5FL_FREE(H5A_shared_t, attr->shared);
- } /* end if */
+ /* Free any dynamically allocated items */
+ if(H5A__free(attr) < 0)
+ HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, NULL, "can't release attribute info")
attr = H5FL_FREE(H5A_t, attr);
} /* end if */