From 5098894ffde76620db2798fba900287aaf518166 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 11 Jun 2019 04:09:27 -0700 Subject: Fixed a memory issue where unfreed shared attribute dataspace memory tripped an assert in our memory sanity checks. Fixes HDFFV-10774. --- src/H5Oattr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- cgit v0.12