Abdullah bin Zaid (may Allah be pleased with him) narrates that it was said to the Messenger of Allah (peace be upon him): "If a person has a thought of losing his ablution during prayer (what should he do)?" The Prophet (peace be upon him) said: "He should not turn back (i.e., break his prayer) unless he hears a sound or perceives a smell."
Hadith Referenceمسند الإمام الشافعي / كتاب الطهارة / 65
Hadith Takhrijأخرجه البخاري: الوضوء، باب لا يتوضأ من الشك حتى يستيقن (137)، ومسلم، الحيض باب الدليل على أن من تيقن الطهارة ثم شك في الحدث فله ان يصلى بطهارته تلك : (361).