From 08fb72859d8ea1be0fbfd294e4499664ce2f94db Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 3 Feb 2010 10:33:44 -0500 Subject: [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) --- src/H5MM.c | 31 +++++++++++++------------------ 1 file 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() */ /*------------------------------------------------------------------------- -- cgit v0.12