mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Fixed a memory problem in Array#to_h
Reported from Alex Snaps via Mathieu Leduc-Hamel, both from shopify.com. Thank you!
This commit is contained in:
@@ -131,7 +131,7 @@ mrb_ary_to_h(mrb_state *mrb, mrb_value ary)
|
||||
|
||||
if (mrb_nil_p(v)) {
|
||||
mrb_raisef(mrb, E_TYPE_ERROR, "wrong element type %S at %S (expected array)",
|
||||
mrb_str_new_cstr(mrb, mrb_obj_classname(mrb, RARRAY_PTR(ary)[i])),
|
||||
mrb_str_new_cstr(mrb, mrb_obj_classname(mrb, ary_elt(ary, i))),
|
||||
mrb_fixnum_value(i)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user