diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2000-07-25 17:27:55 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2000-07-25 17:27:55 (GMT) |
commit | 2a14d16d805762296e53ab25a6bc8b6a39230c11 (patch) | |
tree | 2b6d36d08d46589244959d88174a62d6cefe1e28 /src/H5FL.c | |
parent | 4505e59d473caa5d77de98a85da490e168ee950d (diff) | |
download | hdf5-2a14d16d805762296e53ab25a6bc8b6a39230c11.zip hdf5-2a14d16d805762296e53ab25a6bc8b6a39230c11.tar.gz hdf5-2a14d16d805762296e53ab25a6bc8b6a39230c11.tar.bz2 |
[svn-r2442] Insert better error checking when memory allocation fails (in certain obscure
situations).
Diffstat (limited to 'src/H5FL.c')
-rw-r--r-- | src/H5FL.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -370,7 +370,7 @@ H5FL_term(void) /* Terminating this layer never affects other layers; rather, other layers affect * the termination of this layer. */ return 0; -} +} /* end H5FL_term() */ /*------------------------------------------------------------------------- @@ -694,7 +694,8 @@ H5FL_blk_realloc(H5FL_blk_head_t *head, void *block, size_t new_size) /* check if we are actually changing the size of the buffer */ if(new_size!=temp->size) { - ret_value=H5FL_blk_alloc(head,new_size,0); + if((ret_value=H5FL_blk_alloc(head,new_size,0))==NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for block"); HDmemcpy(ret_value,block,MIN(new_size,temp->size)); H5FL_blk_free(head,block); } /* end if */ @@ -706,6 +707,7 @@ H5FL_blk_realloc(H5FL_blk_head_t *head, void *block, size_t new_size) ret_value=H5FL_blk_alloc(head,new_size,0); #endif /* NO_BLK_FREE_LISTS */ +done: FUNC_LEAVE(ret_value); } /* end H5FL_blk_realloc() */ |