diff options
Diffstat (limited to 'src/H5Fsuper_cache.c')
-rw-r--r-- | src/H5Fsuper_cache.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index 501e64b..d2aaef8 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -111,7 +111,8 @@ H5FL_EXTERN(H5F_super_t); *------------------------------------------------------------------------- */ static H5F_super_t * -H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *udata1, void *udata2/*out*/) +H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, const void UNUSED *udata1, + void *udata2/*out*/) { H5F_super_t *sblock = NULL; /* File's superblock */ haddr_t base_addr = HADDR_UNDEF; /* Base address of file */ @@ -609,6 +610,11 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *udata1 ret_value = sblock; done: + /* Release the [possibly partially initialized] superblock on errors */ + if(!ret_value && sblock) + if(H5F_sblock_dest(f, sblock) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTFREE, NULL, "unable to destroy superblock data") + FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_sblock_load() */ @@ -628,7 +634,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5F_super_t *sblock) +H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t UNUSED addr, + H5F_super_t *sblock) { herr_t ret_value = SUCCEED; |