realloc now handles if p is null and doesn't change p if there isn't enough memory for realloc, all according to iso standard