diff options
Diffstat (limited to 'src/H5Oattr.c')
-rw-r--r-- | src/H5Oattr.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/H5Oattr.c b/src/H5Oattr.c index 971c514..ad068ad 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -234,6 +234,21 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned UNUSED mesg_fl ret_value = attr; done: + if(NULL == ret_value) { + if(attr) { + if(attr->shared) { + /* Free any dynamicly 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 */ + } /* end if */ + + attr = H5FL_FREE(H5A_t, attr); + } /* end if */ + FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_attr_decode() */ |