Remove discareded NULL checks and use mrb_malloc() instead of mrb_realloc().