Language:
كتاب الصلاة
8  
Prayers (Salat)
(61)
Chapter: Al-Hadath (passing wind) in the mosque
(61)
باب الْحَدَثِ فِي الْمَسْجِدِ
Sahih al-Bukhari 445

Narrated Abu Huraira:

Allah's Messenger (ﷺ) said, "The angels keep on asking Allah's forgiveness for anyone of you, as long as he is at his Musalla (praying place) and he does not pass wind (Hadath). They say, 'O Allah! Forgive him, O Allah! be Merciful to him."

حَدَّثَنَا عَبْدُ اللَّهِ بْنُ يُوسُفَ، قَالَ أَخْبَرَنَا مَالِكٌ، عَنْ أَبِي الزِّنَادِ، عَنِ الأَعْرَجِ، عَنْ أَبِي هُرَيْرَةَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏ "‏ الْمَلاَئِكَةُ تُصَلِّي عَلَى أَحَدِكُمْ مَا دَامَ فِي مُصَلاَّهُ الَّذِي صَلَّى فِيهِ، مَا لَمْ يُحْدِثْ، تَقُولُ اللَّهُمَّ اغْفِرْ لَهُ اللَّهُمَّ ارْحَمْهُ ‏"‏‏.‏
Reference : Sahih al-Bukhari 445
In-book reference : Book 8, Hadith 94
USC-MSA web (English) reference : Vol. 1, Book 8, Hadith 436
  (deprecated numbering scheme)