[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.
This commit is contained in:
Raymond Lu 2007-03-05 16:44:55 -05:00
parent ade2b24a44
commit 1b23b0e8c1

View File

@ -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 */