summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5diff_array.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/h5diff_array.c')
-rw-r--r--tools/lib/h5diff_array.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 77e5cf6..bc1ee43 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -5749,16 +5749,18 @@ static
int ull2float(unsigned long long ull_value, float *f_value)
{
hid_t dxpl_id;
- unsigned char *buf;
+ unsigned char *buf = NULL;
size_t src_size;
size_t dst_size;
if((dxpl_id = H5Pcreate(H5P_DATASET_XFER))<0)
- return -1;
+ goto error;
src_size = H5Tget_size(H5T_NATIVE_ULLONG);
dst_size = H5Tget_size(H5T_NATIVE_FLOAT);
buf = (unsigned char*)HDcalloc(1, MAX(src_size, dst_size));
+ if(!buf)
+ goto error;
HDmemcpy(buf, &ull_value, src_size);