then instead of allocating the whole array before freeing the old one, it would free the individual items once at a time.