summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index 3322352224..bf5124e66d 100644
--- a/gc.c
+++ b/gc.c
@@ -95,6 +95,7 @@ xrealloc(ptr, size)
ArgError("negative re-allocation size");
}
if (!ptr) return xmalloc(size);
+ if (size == 0) size = 1;
malloc_memories += size;
mem = realloc(ptr, size);
if (!mem) {