The Messenger of Allah said: "Whoever performs Hajj for Allah, and he does not have sexual relations nor commit any sin, then his previous sins will be forgiven."
Jami` at-Tirmidhi Book 9, Hadith 3