diff options
Diffstat (limited to 'src/struct.c')
| -rw-r--r-- | src/struct.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/struct.c b/src/struct.c index d06124b50..9f7010e0b 100644 --- a/src/struct.c +++ b/src/struct.c @@ -416,12 +416,10 @@ mrb_struct_initialize_withArg(mrb_state *mrb, int argc, mrb_value *argv, mrb_val mrb_raise(mrb, E_ARGUMENT_ERROR, "struct size differs"); } st = RSTRUCT(self); - st->ptr = malloc(sizeof(mrb_value)*argc); + st->ptr = mrb_malloc(mrb, sizeof(mrb_value)*argc); st->len = n; memcpy(st->ptr, argv, sizeof(mrb_value)*argc); - //if (n > argc) { - // mrb_mem_clear(RSTRUCT_PTR(self)+argc, n-argc); - //} + return self; } |
