summaryrefslogtreecommitdiffstats
path: root/test/dsets.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2012-08-12 02:20:43 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2012-08-12 02:20:43 (GMT)
commitcd5ad177a23698c1daf6fb8c4195336865d795d2 (patch)
tree13720372b8dcf964d99cbec2d7ff5de1bdbdd565 /test/dsets.c
parentcd3f42096b9a957e37c9df48aa0d31d9ed4bc537 (diff)
downloadhdf5-cd5ad177a23698c1daf6fb8c4195336865d795d2.zip
hdf5-cd5ad177a23698c1daf6fb8c4195336865d795d2.tar.gz
hdf5-cd5ad177a23698c1daf6fb8c4195336865d795d2.tar.bz2
[svn-r22669] Description:
Merge r22634:2266 from trunk to revise_chunks branch Tested on: Mac OSX/64 10.7.4 (amazon) w/debug, gcc-4.7.x, C++, FORTRAN and threadsafe (h5committest not needed on this branch)
Diffstat (limited to 'test/dsets.c')
-rw-r--r--test/dsets.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/test/dsets.c b/test/dsets.c
index 88e41f7..70d610b 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -1085,8 +1085,8 @@ test_conv_buffer(hid_t fid)
herr_t status = -1;
int j, k, l;
- CmpField *cf;
- CmpFieldR *cfrR;
+ CmpField *cf = NULL;
+ CmpFieldR *cfrR = NULL;
hid_t dataset = -1; /* dataset ID */
hid_t space = -1; /* data space ID */
@@ -1100,7 +1100,7 @@ test_conv_buffer(hid_t fid)
TESTING("data type conversion buffer size");
- cf = (CmpField *)HDcalloc((size_t)1, sizeof(CmpField));
+ if ((cf = (CmpField *)HDcalloc((size_t)1, sizeof(CmpField))) == 0) goto error;
/* Populate the data members */
for(j = 0; j < DIM1; j++)
@@ -1149,7 +1149,7 @@ test_conv_buffer(hid_t fid)
if(H5Tinsert(ctype2, "C", HOFFSET(CmpFieldR, c), arr_type5) < 0) goto error;
/* Read should succeed since library will set conversion buffer big enough */
- cfrR = (CmpFieldR *)HDcalloc((size_t)1, sizeof(CmpFieldR));
+ if ((cfrR = (CmpFieldR *)HDcalloc((size_t)1, sizeof(CmpFieldR))) == 0) goto error;
if(H5Dread(dataset, ctype2, H5S_ALL, H5S_ALL, H5P_DEFAULT, cfrR) < 0) goto error;
/* Read should fail since conversion buffer isn't big enough */
@@ -1186,10 +1186,8 @@ test_conv_buffer(hid_t fid)
if(H5Tclose(arr_type5) < 0) goto error;
if(H5Dclose(dataset) < 0) goto error;
- if(cf)
- HDfree(cf);
- if(cfrR)
- HDfree(cfrR);
+ HDfree(cf);
+ HDfree(cfrR);
puts(" PASSED");
return(0);