Sunan Abi Dawud Book 2, Hadith 82
Abu Hurairah reported the Messenger of Allah (May peace be upon him) as saying; one shall have the thing the for which one comes to the mosque.
O Allah, forgive him? O Allah, take mercy on him, until he turns away, or he is defiled. He was asked: what is meant by defilement? He replied: he breaks wind gently or loudly.
I heard the Messenger of Allah (May peace be upon him) as saying; if anyone hears a man crying out in the mosque about something he has lost, he should say: May Allah not restore it to you, for the mosque were not built for this.