realloc can return NULL.