diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2007-03-05 21:44:55 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2007-03-05 21:44:55 (GMT) |
commit | 1b23b0e8c1416f4b15eb92b5f3fab83bef0e17cf (patch) | |
tree | 362decbe1a69f992bf0fa3bafc634680676b0fd2 /src/H5Ofill.c | |
parent | ade2b24a446d9c755397270d9c64d1372a996614 (diff) | |
download | hdf5-1b23b0e8c1416f4b15eb92b5f3fab83bef0e17cf.zip hdf5-1b23b0e8c1416f4b15eb92b5f3fab83bef0e17cf.tar.gz hdf5-1b23b0e8c1416f4b15eb92b5f3fab83bef0e17cf.tar.bz2 |
[svn-r13459] Fix for Bug #763 - failure to create dataset of variable-length data with fill value. In function
H5O_fill_convert, the background buffer was allocated without clearing. Later in H5T_vlen_disk_write
, library thought there's data in this background buffer. Changed the allocating function to
CALLOC.
Diffstat (limited to 'src/H5Ofill.c')
-rw-r--r-- | src/H5Ofill.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/H5Ofill.c b/src/H5Ofill.c index 1914e0a..b999648 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -811,7 +811,10 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed, hid_ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") HDmemcpy(buf, fill->buf, H5T_get_size(fill->type)); } /* end else */ - if(H5T_path_bkg(tpath) && NULL == (bkg = H5MM_malloc(H5T_get_size(dset_type)))) + + /* Use CALLOC here to clear the buffer in case later the library thinks there's + * data in the background. */ + if(H5T_path_bkg(tpath) && NULL == (bkg = H5MM_calloc(H5T_get_size(dset_type)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") /* Do the conversion */ |