Skip to content

Commit

Permalink
check d->type before accessing d->type->dfree; #1474 #858
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Aug 14, 2013
1 parent b7d6b4d commit f8454e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gc.c
Expand Up @@ -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);
Expand Down

0 comments on commit f8454e5

Please sign in to comment.