Previous commit should have actually used free() and not delete. This fixes that.