Exit if realloc can't alloc memory