Fix invalid free.