GRIM: Do not leak if realloc fails