Fix memory leak after unstuck