diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2019-12-04 17:35:58 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2019-12-04 17:35:58 (GMT) |
commit | aa0b54e27e5d6f0b7c23fe5662d5c8f30898d7f4 (patch) | |
tree | f1c5f1dbe059febe995c8a3f85a93bcfaab5233e /src | |
parent | 62b5de82e2ea095747a26d4e94481b179a79dfc3 (diff) | |
parent | 28294070597c8a04c10e55a843dfe6dbae6ef04c (diff) | |
download | hdf5-aa0b54e27e5d6f0b7c23fe5662d5c8f30898d7f4.zip hdf5-aa0b54e27e5d6f0b7c23fe5662d5c8f30898d7f4.tar.gz hdf5-aa0b54e27e5d6f0b7c23fe5662d5c8f30898d7f4.tar.bz2 |
Merge pull request #2064 in HDFFV/hdf5 from ~NFORTNE2/hdf5_naf:vol_fillval to develop
* commit '28294070597c8a04c10e55a843dfe6dbae6ef04c':
Fix issues with using H5Pget_fill_value() with file datatypes retrieved from H5VLget_file_type().
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Pdcpl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 721ba89..b83e2cf 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -3324,19 +3324,19 @@ H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value/*out*/) */ if(H5T_get_size(type) >= H5T_get_size(fill.type)) { buf = value; - if(H5T_path_bkg(tpath) && NULL == (bkg = H5MM_malloc(H5T_get_size(type)))) + if(H5T_path_bkg(tpath) && NULL == (bkg = H5MM_calloc(H5T_get_size(type)))) HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, FAIL, "memory allocation failed for type conversion") } /* end if */ else { - if(NULL == (buf = H5MM_malloc(H5T_get_size(fill.type)))) + if(NULL == (buf = H5MM_calloc(H5T_get_size(fill.type)))) HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, FAIL, "memory allocation failed for type conversion") - if(H5T_path_bkg(tpath) && NULL == (bkg = H5MM_malloc(H5T_get_size(fill.type)))) + if(H5T_path_bkg(tpath) && NULL == (bkg = H5MM_calloc(H5T_get_size(fill.type)))) HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, FAIL, "memory allocation failed for type conversion") } /* end else */ H5MM_memcpy(buf, fill.buf, H5T_get_size(fill.type)); /* Do the conversion */ - if((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(type, H5T_COPY_TRANSIENT), FALSE)) < 0) + if((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(type, H5T_COPY_ALL), FALSE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to copy/register datatype") if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, buf, bkg) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "datatype conversion failed") |