كتاب الْمَسَاجِدِ وَمَوَاضِعِ الصَّلاَةِ
5  
The Book of Mosques and Places of Prayer
(49)
Chapter: The virtue of offering the obligatory prayers in congregation, the virtue of waiting for prayer and taking many steps towards the masjid, the virtue of walking to the masjid
(49)
باب فَضْلِ صَلاَةِ الْجَمَاعَةِ وَانْتِظَارِ الصَّلاَةِ ‏‏
Sahih Muslim 649 i

Abu Huraira reported Allah's Messenger (ﷺ) as saying:

The servant is constantly in prayer so long as he is in a place of worship waiting for the prayer (to be observed in congregation), and the angels invoke (blessings upon him in these words): O Allah! pardon him. O Allah! show mercy to him, (and they continue to do so) till he returns (from the mosque having completed the prayer) or his ablution breaks. I said: How is the ablution broken? He said: By breaking of the wind noiselessly or with noise.
وَحَدَّثَنِي مُحَمَّدُ بْنُ حَاتِمٍ، حَدَّثَنَا بَهْزٌ، حَدَّثَنَا حَمَّادُ بْنُ سَلَمَةَ، عَنْ ثَابِتٍ، عَنْ أَبِي رَافِعٍ، عَنْ أَبِي هُرَيْرَةَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏ "‏ لاَ يَزَالُ الْعَبْدُ فِي صَلاَةٍ مَا كَانَ فِي مُصَلاَّهُ يَنْتَظِرُ الصَّلاَةَ وَتَقُولُ الْمَلاَئِكَةُ اللَّهُمَّ اغْفِرْ لَهُ اللَّهُمَّ ارْحَمْهُ ‏.‏ حَتَّى يَنْصَرِفَ أَوْ يُحْدِثَ ‏"‏ ‏.‏ قُلْتُ مَا يُحْدِثُ قَالَ يَفْسُو أَوْ يَضْرِطُ ‏.‏
Reference : Sahih Muslim 649i
In-book reference : Book 5, Hadith 342
USC-MSA web (English) reference : Book 4, Hadith 1397
  (deprecated numbering scheme)