(26) بَابُ مَنْ أَصَابَ ذَنْبًا دُونَ الْحَدِّ فَأَخْبَرَ الإِمَامَ فَلاَ عُقُوبَةَ عَلَيْهِ بَعْدَ التَّوْبَةِ إِذَا جَاءَ مُسْتَفْتِيًا
Narrated 'Aisha:
A man came to the Prophet (ﷺ) in the mosque and said, "I am burnt (ruined)!" The Prophet (ﷺ) asked him, "With what (what have you done)?" Hesaid, "I have had sexual relation with my wife in the month of Ramadan(while fasting)." The Prophet (ﷺ) said to him, "Give in charity." He said,"I have nothing." The man sat down, and in the meantime there came a person driving a donkey carrying food to the Prophet (ﷺ) ..... (The sub-narrator, 'Abdur Rahman added: I do not know what kind of food it was). On that the Prophet (ﷺ) said, "Where is the burnt person?" The man said, "Here I am." The Prophet (ﷺ) said to him, "Take this (food) and giveit in charity (to someone)." The man said, "To a poorer person than l?My family has nothing to eat." Then the Prophet (ﷺ) said to him, "Then eat it yourselves."
Reference: Sahih al-Bukhari 6822
In-book reference: Book 86, Hadith 51
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 8, Book 82, Hadith 811