diff options
author | Ruth Aydt <aydt@hdfgroup.org> | 2014-05-27 17:38:49 (GMT) |
---|---|---|
committer | Ruth Aydt <aydt@hdfgroup.org> | 2014-05-27 17:38:49 (GMT) |
commit | 51a255492b7a10ab80d06fcbd5c0e17098afe036 (patch) | |
tree | f0c6e8b649301d8cfbb4aeb92fb88e61822b0943 /examples/h5ff_client_M7.2-pep_demo.c | |
parent | 4687e48c506c3c2a6901370f39ba6adce9a05d8c (diff) | |
download | hdf5-51a255492b7a10ab80d06fcbd5c0e17098afe036.zip hdf5-51a255492b7a10ab80d06fcbd5c0e17098afe036.tar.gz hdf5-51a255492b7a10ab80d06fcbd5c0e17098afe036.tar.bz2 |
[svn-r25221] Added checks for failed malloc/calloc
Diffstat (limited to 'examples/h5ff_client_M7.2-pep_demo.c')
-rw-r--r-- | examples/h5ff_client_M7.2-pep_demo.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/h5ff_client_M7.2-pep_demo.c b/examples/h5ff_client_M7.2-pep_demo.c index 3183e3c..7d5db8a 100644 --- a/examples/h5ff_client_M7.2-pep_demo.c +++ b/examples/h5ff_client_M7.2-pep_demo.c @@ -580,9 +580,9 @@ int main( int argc, char **argv ) { /* Find entries in first Map, then use to create value vectors for all three Map objects - we know they have same size. */
ret = H5Mget_count_ff( map_l_id, &map_entries, rc_id, H5_EVENT_STACK_NULL ); ASSERT_RET;
- value_l = (int *)calloc( map_entries, sizeof(int) );
- value_p = (int *)calloc( map_entries, sizeof(int) );
- value_s = (int *)calloc( map_entries, sizeof(int) );
+ value_l = (int *)calloc( map_entries, sizeof(int) ); assert( value_l != NULL );
+ value_p = (int *)calloc( map_entries, sizeof(int) ); assert( value_p != NULL );
+ value_s = (int *)calloc( map_entries, sizeof(int) ); assert( value_s != NULL );
/* Read Datasets and then Maps in all 3 Groups, measuring time it takes to read data for each*/
@@ -1139,7 +1139,7 @@ print_container_contents( hid_t file_id, hid_t rc_id, const char* grp_path, int assert( nDims == 1 );
totalSize = current_size[0];
- data = (int *)calloc( totalSize, sizeof(int) );
+ data = (int *)calloc( totalSize, sizeof(int) ); assert( data != NULL );
ret = H5Dread_ff( dset_id, H5T_NATIVE_INT, space_id, space_id, H5P_DEFAULT, data, rc_id, H5_EVENT_STACK_NULL ); ASSERT_RET;
@@ -1169,7 +1169,7 @@ print_container_contents( hid_t file_id, hid_t rc_id, const char* grp_path, int assert( map_id >= 0 );
ret = H5Mget_count_ff( map_id, &totalCount, rc_id, H5_EVENT_STACK_NULL ); ASSERT_RET;
- value = (int *)calloc( totalCount, sizeof(int) );
+ value = (int *)calloc( totalCount, sizeof(int) ); assert( value != NULL );
for ( i = 0; i < totalCount; i++ ) {
ret = H5Mget_ff( map_id, H5T_STD_I32LE, &i, H5T_STD_I32LE, &value[i], H5P_DEFAULT, rc_id, H5_EVENT_STACK_NULL );
|