summaryrefslogtreecommitdiffstats
path: root/src/H5Ofill.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Ofill.c')
-rw-r--r--src/H5Ofill.c5
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 */