check d->type before accessing d->type->dfree; #1474 #858

parent b7d6b4d0
......@@ -646,7 +646,7 @@ obj_free(mrb_state *mrb, struct RBasic *obj)
case MRB_TT_DATA:
{
struct RData *d = (struct RData*)obj;
if (d->type->dfree) {
if (d->type && d->type->dfree) {
d->type->dfree(mrb, d->data);
}
mrb_gc_free_iv(mrb, (struct RObject*)obj);
......
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