Avoid a double free()