summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdk-stage1/insmod-busybox/utility.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mdk-stage1/insmod-busybox/utility.c b/mdk-stage1/insmod-busybox/utility.c
index b9a115c72..ffd323347 100644
--- a/mdk-stage1/insmod-busybox/utility.c
+++ b/mdk-stage1/insmod-busybox/utility.c
@@ -1422,7 +1422,10 @@ extern void *xmalloc(size_t size)
extern void *xrealloc(void *old, size_t size)
{
- void *ptr = realloc(old, size);
+ void *ptr;
+ if (!size)
+ size = 1;
+ ptr = realloc(old, size);
if (!ptr)
fatalError("memory_exhausted");
return ptr;