Unverified Commit 126f0f05 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #5292 from dearblue/objspace-memsize

Fix NULL pointer dereference with mruby-os-memsize and mruby-method
parents 0aa8db9a 0fdf5d9b
......@@ -33,6 +33,7 @@ os_memsize_of_method(mrb_state* mrb, mrb_value method_obj)
size_t size;
mrb_value proc_value = mrb_obj_iv_get(mrb, mrb_obj_ptr(method_obj),
mrb_intern_lit(mrb, "_proc"));
if (mrb_nil_p(proc_value)) return 0;
struct RProc *proc = mrb_proc_ptr(proc_value);
size = sizeof(struct RProc);
......
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