summaryrefslogtreecommitdiffhomepage
path: root/utility.c
diff options
context:
space:
mode:
Diffstat (limited to 'utility.c')
-rw-r--r--utility.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/utility.c b/utility.c
index 50f497ff6..565fd735c 100644
--- a/utility.c
+++ b/utility.c
@@ -1465,13 +1465,21 @@ extern void *xmalloc(size_t size)
return ptr;
}
-void *xrealloc(void *old, size_t size)
+extern void *xrealloc(void *old, size_t size)
{
void *ptr = realloc(old, size);
if (!ptr)
fatalError(memory_exhausted);
return ptr;
}
+
+extern void *xcalloc(size_t nmemb, size_t size)
+{
+ void *ptr = calloc(nmemb, size);
+ if (!ptr)
+ fatalError(memory_exhausted);
+ return ptr;
+}
#endif
#if defined BB_FEATURE_NFSMOUNT