The Messenger of Allah ﷺ said, "If one of you feels something in his stomach and is uncertain whether anything has come out of him or not, he should not leave the mosque until he hears a sound or detects an odor."
قال رسول الله ﷺ: إذا وجد أحدكم في بطنه شيئا فأشكل عليه، أخرج منه شيء أم لا؛ فلا يخرجن من المسجد حتى يسمع صوتا أو يجد ريحا.
Muslim reported it in the Book of Menstruation (362) from Zuhayr bin Harb, from Jareer, from Suhayl, from his father, from Abu Hurairah. Tirmidhi (74) and Ibn Majah (515) reported it through the route of Shubah, from Suhayl, with the same chain, but abridged it with the wording, "There is no wudu except from a sound or a smell." Ibn Khuzayma (27) reported it through this same route as well.