Narrated Ali ibn Talq:
The Messenger of Allah (ﷺ) said: When any of you breaks wind during the prayer, he should turn away and perform ablution and repeat the prayer.