summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-02-03 15:33:44 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-02-03 15:33:44 (GMT)
commit08fb72859d8ea1be0fbfd294e4499664ce2f94db (patch)
tree9ecc2d524a0b172713f121a10fdf047bacd2832b /src
parent26c1c19e28af725578d539391fbc4f63f0500856 (diff)
downloadhdf5-08fb72859d8ea1be0fbfd294e4499664ce2f94db.zip
hdf5-08fb72859d8ea1be0fbfd294e4499664ce2f94db.tar.gz
hdf5-08fb72859d8ea1be0fbfd294e4499664ce2f94db.tar.bz2
[svn-r18207] 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)
Diffstat (limited to 'src')
-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() */
/*-------------------------------------------------------------------------