Sahih Muslim | Book 3 | Chapter 25

Narrated by 'Abbad b. Tamim
'Abbad b. Tamim reported from his uncle that a person made a complaint to the Apostle (may peace be upon him) that he entertained (doubt) as it something had happened to him breaking his ablution. He (the Holy Prophet) said: He should not return (from prayer) unless he hears a sound or perceives a smell (of passing wind). Abu Bakr and Zuhair b. Harb have pointed out in their narrations that it was 'Abdullah b. Zaid.

Narrated by Abu Huraira
Abu Huraira reported: The Messenger of Allah (may peace be upon him) said: If any one of you has pain in his abdomen, but is doubtful whether or not anything has issued from him, be should not leave the mosque unless he hears a sound or perceives a smell.