summaryrefslogtreecommitdiffhomepage
path: root/src/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gc.c')
-rw-r--r--src/gc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gc.c b/src/gc.c
index 253128a44..30391a081 100644
--- a/src/gc.c
+++ b/src/gc.c
@@ -227,11 +227,9 @@ mrb_calloc(mrb_state *mrb, size_t nelem, size_t len)
nelem <= SIZE_MAX / len) {
size_t size;
size = nelem * len;
- p = mrb_realloc(mrb, 0, size);
+ p = mrb_malloc(mrb, size);
- if (p) {
- memset(p, 0, size);
- }
+ memset(p, 0, size);
}
else {
p = NULL;