Ali instructed him to ask the Messenger of Allah ﷺ about a man who, when approaching his wife, has madhi come out of him, what is required of him. Ali said, "His daughter is married to me, and I feel too shy to ask him myself."So I asked the Messenger of Allah ﷺ about that, and he said, "When any of you experiences that, let him wash his private part and perform ablution as he does for prayer."
أخبرنا عتبة بن عبد الله المروزي عن مالك وهو ابن أنس عن أبي النضر عن سليمان بن يسار
أن عليا أمره أن يسأل رسول الله ﷺ عن الرجل إذا دنا من أهله فخرج منه المذي ماذا عليه فإن عندي ابنته وأنا أستحي أن أسأله فسألت رسول الله ﷺ عن ذلك فقال إذا وجد أحدكم ذلك فلينضح فرجه ويتوضأ وضوءه للصلاة
[Sahih] Reported by Abu Dawud, Purification, chapter on madhi, no. 207, and Ibn Majah, Purification, chapter on wudu from madhi, no. 505, from the hadith of Malik with this wording, and it is found in Muwatta (Yahya) 1/40. Ibn Khuzayma and Ibn Hibban graded it sahih, but its chain is not connected, as Ibn Abdul-Barr and others have stated. It has a corroborating narration in Sahih Muslim, no. 303, and elsewhere, and by this the hadith is confirmed to be sahih.