summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5diff_array.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2013-05-11 15:59:48 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2013-05-11 15:59:48 (GMT)
commitd38fe20df6bdb30906b18cf01ee644c44ed5b944 (patch)
treef9ebbcca3baaf76c5e4c4bcc5139e551cf3d6a0c /tools/lib/h5diff_array.c
parent5ecebe5b9bc161153a3391bf32eb64687f675172 (diff)
downloadhdf5-d38fe20df6bdb30906b18cf01ee644c44ed5b944.zip
hdf5-d38fe20df6bdb30906b18cf01ee644c44ed5b944.tar.gz
hdf5-d38fe20df6bdb30906b18cf01ee644c44ed5b944.tar.bz2
[svn-r23695] Description:
Clean up warnings in H5Tconv.c (down to _only_ 9000 lines of output now!) Merge changes from Coverity branch back to trunk: r20684: Fix for coverity bug #1721 which was due to the fix for coverity bug #943. r20685: Use HDstrncpy. --gh r20761: Purpose: Fix valgrind issues Description: Free image_data and data as appropriate in test_image. r20762: Purpose: Fix coverity issue 600 Description: Add check for return value of H5O_close in H5Ocopy. Also cleaned up various warnings. r20763: Purpose: Fix valgrind issues with h5stat Description: Modified h5stat to free "iter" before exit, and free "hand" before exit if parse_command_line exits directly. r20764: fixed coverity issues: 69, 327, 614, 684, 685, 696, 697, 1681, 967, 826, 660, 80 r20765: Fixed coverity bug 668 Pulled x * y * z multiply out of malloc operand into a separate n_elements variable to quiet integer overflow warning. No actual integer overflow tests are performed since it's just a test program but I did add a check that n_elements is >= 1. I also changed an error condition from doing its own close and returning -1 to "goto out;" like the rest of the program. r20766: Fixed coverity bug 667 Pulled x * y * z multiply out of malloc operand into a separate n_elements variable to quiet integer overflow warning. No actual integer overflow tests are performed since it's just a test program. Tested on: Mac OSX/64 10.8.3 (amazon) w/C++ & FORTRAN (h5committest upcoming)
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 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);