summaryrefslogtreecommitdiffstats
path: root/src/H5MM.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5MM.c')
-rw-r--r--src/H5MM.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/H5MM.c b/src/H5MM.c
index 1de4880..c27f9d1 100644
--- a/src/H5MM.c
+++ b/src/H5MM.c
@@ -110,7 +110,8 @@ H5MM_calloc(size_t size)
* H5MM_realloc (NULL, 0) <==> NULL
*
* Return: Success: Ptr to new memory or NULL if the memory
- * was freed.
+ * was freed or HDrealloc couldn't allocate
+ * memory.
*
* Failure: NULL
*
@@ -130,17 +131,14 @@ H5MM_realloc(void *mem, size_t size)
if(NULL == mem) {
if(0 == size)
- mem = NULL;
+ ret_value = NULL;
else
- mem = H5MM_malloc(size);
+ ret_value = H5MM_malloc(size);
} /* end if */
else if(0 == size)
- mem = H5MM_xfree(mem);
+ ret_value = H5MM_xfree(mem);
else
- mem = HDrealloc(mem, size);
-
- /* Set return value */
- ret_value = mem;
+ ret_value = HDrealloc(mem, size);
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5MM_realloc() */