translate: Move freeing of frame to after it is used.