Merge pull request #5292 from dearblue/objspace-memsize

Fix NULL pointer dereference with mruby-os-memsize and mruby-method
This commit is contained in:
Yukihiro "Matz" Matsumoto
2021-01-16 17:55:43 +09:00
committed by GitHub
+1
View File
@@ -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);