Language:
كتاب الحدود
86  
Limits and Punishments set by Allah (Hudood)
(26)
Chapter: If somebody commits a sin less than the legal punishment and informs the ruler, no punishment is to be inflicted on him after his repentance
(26)
بَابُ مَنْ أَصَابَ ذَنْبًا دُونَ الْحَدِّ فَأَخْبَرَ الإِمَامَ فَلاَ عُقُوبَةَ عَلَيْهِ بَعْدَ التَّوْبَةِ إِذَا جَاءَ مُسْتَفْتِيًا
Sahih al-Bukhari 6821

Narrated Abu Huraira:

A person had sexual relation with his wife in the month of Ramadan (while he was fasting), and he came to Allah's Messenger (ﷺ) seeking his verdict concerning that action. The Prophet (ﷺ) said (to him), "Can you afford to manumit a slave?" The man said, "No." The Prophet (ﷺ) said, "Can you fast for two successive months?" He said, "No." The Prophet (ﷺ) said, "Then feed sixty poor persons."

حَدَّثَنَا قُتَيْبَةُ، حَدَّثَنَا اللَّيْثُ، عَنِ ابْنِ شِهَابٍ، عَنْ حُمَيْدِ بْنِ عَبْدِ الرَّحْمَنِ، عَنْ أَبِي هُرَيْرَةَ ـ رضى الله عنه ـ أَنَّ رَجُلاً، وَقَعَ بِامْرَأَتِهِ فِي رَمَضَانَ، فَاسْتَفْتَى رَسُولَ اللَّهِ صلى الله عليه وسلم فَقَالَ ‏"‏ هَلْ تَجِدُ رَقَبَةً ‏"‏‏.‏ قَالَ لاَ‏.‏ قَالَ ‏"‏ هَلْ تَسْتَطِيعُ صِيَامَ شَهْرَيْنِ ‏"‏‏.‏ قَالَ لاَ‏.‏ قَالَ ‏"‏ فَأَطْعِمْ سِتِّينَ مِسْكِينًا ‏"‏‏.‏
Reference : Sahih al-Bukhari 6821
In-book reference : Book 86, Hadith 49
USC-MSA web (English) reference : Vol. 8, Book 82, Hadith 811
  (deprecated numbering scheme)