diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c index e718605b5a3..82977b3253c 100644 --- a/hl/src/H5TB.c +++ b/hl/src/H5TB.c @@ -2025,7 +2025,7 @@ H5TBinsert_field(hid_t loc_id, const char *dset_name, const char *field_name, hi goto out; /* alloc fill value attribute buffer */ - if (NULL == (tmp_fill_buf = (unsigned char *)malloc(total_size))) + if (NULL == (tmp_fill_buf = (unsigned char *)calloc(1, total_size))) goto out; /* get the fill value attributes */ diff --git a/hl/test/test_table.c b/hl/test/test_table.c index c6614343037..8996fa46480 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -376,6 +376,8 @@ test_table(hid_t fid, int do_write) field_type[3] = H5T_NATIVE_DOUBLE; field_type[4] = H5T_NATIVE_INT; + memset(wbufd, 0, NRECORDS * sizeof(particle_t)); + /*------------------------------------------------------------------------- * * Functions tested: