diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-08-20 21:37:12 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-08-20 21:37:12 (GMT) |
commit | 47c3bc7540869f53f0b734c68d3289835f0a546d (patch) | |
tree | 90e688dc21b095d9d3d36e944465ac79eff05348 /src/H5Dfill.c | |
parent | b2012d9f74843ec87b31b7aca0c3ad8b6b6fe448 (diff) | |
download | hdf5-47c3bc7540869f53f0b734c68d3289835f0a546d.zip hdf5-47c3bc7540869f53f0b734c68d3289835f0a546d.tar.gz hdf5-47c3bc7540869f53f0b734c68d3289835f0a546d.tar.bz2 |
[svn-r19272] Description:
Close out various resource leaks and usages of uninitialized memory that
were flagged by valgrind. [There's still some more valgrind warnings, but
it's better now... :-/ ]
Also clean up warnings and code formatting.
Tested on:
Mac OS X/32 10.6.4 (amazon) w/debug & valgrind
(h5committest forthcoming)
Diffstat (limited to 'src/H5Dfill.c')
-rw-r--r-- | src/H5Dfill.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/H5Dfill.c b/src/H5Dfill.c index 467ce4b..f6e07f2 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -585,7 +585,7 @@ H5D_fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "data type conversion failed") /* Replicate the fill value into the cached buffer */ - H5V_array_fill(fb_info->fill_buf, fb_info->fill_buf, fb_info->mem_elmt_size, nelmts); + H5V_array_fill((void *)((unsigned char *)fb_info->fill_buf + fb_info->mem_elmt_size), fb_info->fill_buf, fb_info->mem_elmt_size, nelmts); /* Reset the entire background buffer, if necessary */ if(H5T_path_bkg(fb_info->mem_to_dset_tpath)) @@ -606,12 +606,14 @@ H5D_fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "data type conversion failed") done: - if (buf) { + if(buf) { /* Free dynamically allocated VL elements in fill buffer */ - if (fb_info->fill->type) - H5T_vlen_reclaim_elmt(buf, fb_info->fill->type, dxpl_id); + if(fb_info->fill->type) + if(H5T_vlen_reclaim_elmt(buf, fb_info->fill->type, dxpl_id) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't reclaim vlen element") else - H5T_vlen_reclaim_elmt(buf, fb_info->mem_type, dxpl_id); + if(H5T_vlen_reclaim_elmt(buf, fb_info->mem_type, dxpl_id) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't reclaim vlen element") /* Free temporary fill buffer */ if(fb_info->fill_free_func) |