summaryrefslogtreecommitdiffstats
path: root/src/H5Dchunk.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-12-10 17:43:14 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-12-10 17:43:14 (GMT)
commit9d06256018fbebbefa08879ae9f16696a5bbef19 (patch)
treedb84f4d812d122c8c9fafbcc4b828fc12cbf6a8e /src/H5Dchunk.c
parenta4750dfae7e187f95c4515939968e6fce880efed (diff)
downloadhdf5-9d06256018fbebbefa08879ae9f16696a5bbef19.zip
hdf5-9d06256018fbebbefa08879ae9f16696a5bbef19.tar.gz
hdf5-9d06256018fbebbefa08879ae9f16696a5bbef19.tar.bz2
[svn-r17987] Description:
Bring r17945:17986 from trunk to revise_chunks branch (needs to have autotools files regenerated before testing, those will be checked in in a few minutes)
Diffstat (limited to 'src/H5Dchunk.c')
-rw-r--r--src/H5Dchunk.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index 5b1703a..95334af 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -2480,6 +2480,7 @@ H5D_chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t *
done:
/* Free the temp buffer only if it's different than the entry chunk */
if(buf != ent->chunk)
+ /* coverity["double_free"] */
H5MM_xfree(buf);
/*
@@ -4256,7 +4257,7 @@ H5D_chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
/* Check parameter for type conversion */
if(udata->do_convert) {
- if(H5T_detect_class(udata->dt_src, H5T_VLEN) > 0)
+ if(H5T_detect_class(udata->dt_src, H5T_VLEN, FALSE) > 0)
is_vlen = TRUE;
else if((H5T_get_class(udata->dt_src, FALSE) == H5T_REFERENCE) && (udata->file_src != udata->idx_info_dst->f))
fix_ref = TRUE;
@@ -4502,7 +4503,7 @@ H5D_chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src,
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register source file datatype")
/* If there's a VLEN source datatype, set up type conversion information */
- if(H5T_detect_class(dt_src, H5T_VLEN) > 0) {
+ if(H5T_detect_class(dt_src, H5T_VLEN, FALSE) > 0) {
H5T_t *dt_dst; /* Destination datatype */
H5T_t *dt_mem; /* Memory datatype */
size_t mem_dt_size; /* Memory datatype size */
@@ -4514,16 +4515,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)))
@@ -4553,7 +4560,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 */