Fix mismatched allocation/deallocation.