Ali narrated that the Messenger of Allah[salallahualaihiwasallam] said,
He who sins in this life and was punished for it, then Allah is far more just than to combine two punishments on His servant. He who commits an error in this life and Allah hides this error and pardons him, then Allah is far more generous than to punish the servant for something that He has already pardoned.
Recorded by Ahmad, Ibn Majah and At-Tirmidhi who said, "Hasan Gharib.''