aboutsummaryrefslogtreecommitdiff
path: root/xmalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'xmalloc.c')
-rw-r--r--xmalloc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/xmalloc.c b/xmalloc.c
index ded7f4e3..0a67cdb2 100644
--- a/xmalloc.c
+++ b/xmalloc.c
@@ -36,6 +36,13 @@ xrealloc(void *ptr, size_t size)
return unlikely(size == 0) ? alloc : check_alloc(alloc);
}
+void *
+xreallocarray(void *ptr, size_t n, size_t size)
+{
+ void *alloc = reallocarray(ptr, n, size);
+ return unlikely(size == 0) ? alloc : check_alloc(alloc);
+}
+
char *
xstrdup(const char *str)
{