He divorced his wife while she was menstruating during the lifetime of the Messenger of Allah ﷺ. Umar bin Khattab asked the Messenger of Allah ﷺ about that, and the Messenger of Allah ﷺ said, "Order him to take her back, then keep her until she becomes pure, then menstruates, then becomes pure again. After that, if he wishes, he may keep her, and if he wishes, he may divorce her before touching her. That is the waiting period which Allah
has commanded for the divorce of women."
أخبرنا محمد بن سلمة قال أنبأنا ابن القاسم عن مالك عن نافع
أنه طلق امرأته وهي حائض في عهد رسول الله ﷺ فسأل عمر بن الخطاب رضي الله عنه رسول الله ﷺ عن ذلك فقال رسول الله ﷺ مره فليراجعها ثم ليمسكها حتى تطهر ثم تحيض ثم تطهر ثم إن شاء أمسك بعد وإن شاء طلق قبل أن يمس فتلك العدة التي أمر الله عز وجل أن تطلق لها النساء
Bukhari narrated it in the Book of Divorce, the chapter on Allah's saying, "O Prophet, when you divorce women..." [continuing to the end of the passage], hadith no. 5251, and Muslim in the Book of Divorce, the chapter on the prohibition of divorcing a menstruating woman without her consent, hadith no. 1471, both from the hadith of Malik through this same chain. It is also found in the Muwatta (narrated by Yahya) 2/576, and in al-Kubra, hadith no. 5583.