summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2000-07-25 17:27:55 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2000-07-25 17:27:55 (GMT)
commit2a14d16d805762296e53ab25a6bc8b6a39230c11 (patch)
tree2b6d36d08d46589244959d88174a62d6cefe1e28
parent4505e59d473caa5d77de98a85da490e168ee950d (diff)
downloadhdf5-2a14d16d805762296e53ab25a6bc8b6a39230c11.zip
hdf5-2a14d16d805762296e53ab25a6bc8b6a39230c11.tar.gz
hdf5-2a14d16d805762296e53ab25a6bc8b6a39230c11.tar.bz2
[svn-r2442] Insert better error checking when memory allocation fails (in certain obscure
situations).
-rw-r--r--src/H5FL.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/H5FL.c b/src/H5FL.c
index 7fab4d0..e4dd7a4 100644
--- a/src/H5FL.c
+++ b/src/H5FL.c
@@ -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() */