diff options
Diffstat (limited to 'hl')
-rw-r--r-- | hl/test/test_ds.c | 4 | ||||
-rw-r--r-- | hl/tools/gif2h5/h52gifgentst.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index 3ca1e4d..091a98b 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -410,8 +410,8 @@ herr_t create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int long s44_wbuf[DIM4_SIZE] = {280,280}; /* Allocate buffer */ - buf = (long *)HDmalloc(sizeof(long) * DIM1_SIZE * DIM2_SIZE * DIM3_SIZE * DIM4_SIZE); - HDassert(buf); + if(NULL == (buf = (long *)HDmalloc(sizeof(long) * DIM1_SIZE * DIM2_SIZE * DIM3_SIZE * DIM4_SIZE))) + return FAIL; /* make a dataset */ if(H5LTmake_dataset_long(fid, dsname, rank, dims, buf) >= 0) { diff --git a/hl/tools/gif2h5/h52gifgentst.c b/hl/tools/gif2h5/h52gifgentst.c index 6a41028..39e950b 100644 --- a/hl/tools/gif2h5/h52gifgentst.c +++ b/hl/tools/gif2h5/h52gifgentst.c @@ -57,8 +57,8 @@ int main(void) hsize_t height = HEIGHT; /* Allocate buffer */ - buf = (unsigned char *)malloc(WIDTH * HEIGHT); - assert(buf); + if(NULL == (buf = (unsigned char *)malloc(WIDTH * HEIGHT))) + return EXIT_FAILURE; /* create a file */ if ((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0) |