diff options
Diffstat (limited to 'tools/lib/h5diff_array.c')
-rw-r--r-- | tools/lib/h5diff_array.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 528fc40..96b508d 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -5783,17 +5783,19 @@ 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; h5difftrace("ull2float start\n"); 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); |