diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2019-06-11 11:09:27 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2019-06-11 17:59:41 (GMT) |
commit | c4ee9ef7c05ce79e4503c1e5b3edfe8f912de60e (patch) | |
tree | fd0a24c6b63f7cc2ae8cd72675d062c540a3630c /src/H5S.c | |
parent | 48b0ff7724331737140ffae194cb2e741f0b668d (diff) | |
download | hdf5-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/H5S.c')
-rw-r--r-- | src/H5S.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -448,10 +448,14 @@ H5S_close(H5S_t *ds) if(H5S__extent_release(&ds->extent) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release dataspace extent") - /* Release the main structure */ - ds = H5FL_FREE(H5S_t, ds); - done: + /* Release the main structure. + * Always do this to ensure that we don't leak memory when calling this + * function on partially constructed dataspaces (which will fail one or + * both of the above calls) + */ + H5FL_FREE(H5S_t, ds); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_close() */ |