Priests are not considered infallible. They repent (should they choose to do so) by attending confession (with another priest, or perhaps a higher up like a bishop or cardinal - I'm not sure)... and they are absolved. The only way they'd go to prison is if they confessed their crimes to LE, or their victims held them accountable and proved a case against them. So if they attend confession, speak of their sins, say a few prayers or follow recommendations by the priest who heard the confession (eg: do community service, pray, etc)... then they are considered forgiven by God. The forgiveness of fellow humans is irrelevant to one's own absolution -- the only judge a Catholic answers to is God.