summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-02-03 15:32:02 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-02-03 15:32:02 (GMT)
commit1eced774db51cab28e1bdbed83088d8186c863e8 (patch)
tree6c6c24a23dd057ec4ad3ba09aa2c242de65e02b9
parentc8d05fbe4d4d135ee2ec352f6437e43bdbe423b7 (diff)
downloadhdf5-1eced774db51cab28e1bdbed83088d8186c863e8.zip
hdf5-1eced774db51cab28e1bdbed83088d8186c863e8.tar.gz
hdf5-1eced774db51cab28e1bdbed83088d8186c863e8.tar.bz2
[svn-r18206] Description:
Removed assert() statement when HDrealloc() returned NULL in H5MM_realloc(). Tested on: Mac OS X/32 10.6.2 (amazon) w/debug (too minor to require h5committest)
-rw-r--r--src/H5MM.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/src/H5MM.c b/src/H5MM.c
index 14e847b..1de4880 100644
--- a/src/H5MM.c
+++ b/src/H5MM.c
@@ -112,14 +112,12 @@ H5MM_calloc(size_t size)
* Return: Success: Ptr to new memory or NULL if the memory
* was freed.
*
- * Failure: abort()
+ * Failure: NULL
*
* Programmer: Robb Matzke
* matzke@llnl.gov
* Jul 10 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void *
@@ -128,27 +126,24 @@ H5MM_realloc(void *mem, size_t size)
void *ret_value;
/* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5MM_realloc);
-
- if (!mem) {
- if (0 == size)
- HGOTO_DONE(NULL);
- mem = H5MM_malloc(size);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5MM_realloc)
- } else if (0 == size) {
+ if(NULL == mem) {
+ if(0 == size)
+ mem = NULL;
+ else
+ mem = H5MM_malloc(size);
+ } /* end if */
+ else if(0 == size)
mem = H5MM_xfree(mem);
-
- } else {
+ else
mem = HDrealloc(mem, size);
- assert(mem);
- }
/* Set return value */
- ret_value=mem;
+ ret_value = mem;
-done:
- FUNC_LEAVE_NOAPI(ret_value);
-}
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5MM_realloc() */
/*-------------------------------------------------------------------------