summaryrefslogtreecommitdiff
path: root/xmalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'xmalloc.c')
-rw-r--r--xmalloc.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/xmalloc.c b/xmalloc.c
index bdb6234..18972fb 100644
--- a/xmalloc.c
+++ b/xmalloc.c
@@ -108,11 +108,7 @@ void *xrealloc(void *ptr, size_t nmemb, size_t size)
if (unlikely(((size_t) ~0) / nmemb < size))
panic("xrealloc: nmemb * size > SIZE_T_MAX\n");
- if (ptr == NULL)
- new_ptr = malloc(new_size);
- else
- new_ptr = realloc(ptr, new_size);
-
+ new_ptr = realloc(ptr, new_size);
if (unlikely(new_ptr == NULL))
panic("xrealloc: out of memory (new_size %zu bytes)\n",
new_size);