Commit 5d9945ba authored by Frank Celler's avatar Frank Celler

fixed wrong malloc size

parent 98be612e
...@@ -444,7 +444,7 @@ read_rite_irep_record(mrb_state *mrb, unsigned char *src, mrb_irep *irep, uint32 ...@@ -444,7 +444,7 @@ read_rite_irep_record(mrb_state *mrb, unsigned char *src, mrb_irep *irep, uint32
irep->slen = bin_to_uint32(src); //syms length irep->slen = bin_to_uint32(src); //syms length
src += MRB_DUMP_SIZE_OF_LONG; src += MRB_DUMP_SIZE_OF_LONG;
if (irep->slen > 0) { if (irep->slen > 0) {
if ((irep->syms = mrb_malloc(mrb, MRB_DUMP_SIZE_OF_INT * irep->slen)) == NULL) { if ((irep->syms = mrb_malloc(mrb, sizeof(mrb_sym) * irep->slen)) == NULL) {
ret = MRB_DUMP_INVALID_IREP; ret = MRB_DUMP_INVALID_IREP;
goto error_exit; goto error_exit;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment