diff options
Diffstat (limited to 'src/H5Dchunk.c')
-rw-r--r-- | src/H5Dchunk.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index cb7901e..f90e7fa 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -4396,16 +4396,22 @@ H5D_chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, /* create a memory copy of the variable-length datatype */ if(NULL == (dt_mem = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy") - if((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, FALSE)) < 0) + if((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, FALSE)) < 0) { + (void)H5T_close(dt_mem); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register memory datatype") + } /* end if */ /* create variable-length datatype at the destinaton file */ if(NULL == (dt_dst = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy") - if(H5T_set_loc(dt_dst, f_dst, H5T_LOC_DISK) < 0) + if(H5T_set_loc(dt_dst, f_dst, H5T_LOC_DISK) < 0) { + (void)H5T_close(dt_dst); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "cannot mark datatype on disk") - if((tid_dst = H5I_register(H5I_DATATYPE, dt_dst, FALSE)) < 0) + } /* end if */ + if((tid_dst = H5I_register(H5I_DATATYPE, dt_dst, FALSE)) < 0) { + (void)H5T_close(dt_dst); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register destination file datatype") + } /* end if */ /* Set up the conversion functions */ if(NULL == (tpath_src_mem = H5T_path_find(dt_src, dt_mem, NULL, NULL, dxpl_id, FALSE))) @@ -4435,7 +4441,7 @@ H5D_chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, /* Atomize */ if((sid_buf = H5I_register(H5I_DATASPACE, buf_space, FALSE)) < 0) { - H5S_close(buf_space); + (void)H5S_close(buf_space); HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID") } /* end if */ |