diff options
Diffstat (limited to 'utility.c')
-rw-r--r-- | utility.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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 |