I had also heard it from Uqba, but I remember Ubayd's version better. He said, "I got married, and a black woman came to us and said, 'I have nursed both of you.' So I went to the Prophet ﷺ and said, 'I married such-and-such woman, daughter of so-and-so, and a black woman came to us and claimed that she had nursed both of us, and she is a disbeliever.' He turned away from me, so I came around to face him and said, 'She is lying.'He said to me, 'How can you stay with her when she has claimed that she nursed both of you? Leave her.'"
قال حدثنا إسماعيل بن إبراهيم قال أخبرنا أيوب عن عبد الله بن أبي مليكة قال حدثني عبيد بن أبي مريم
وقد سمعته من عقبة ولكني لحديث عبيد أحفظ قال تزوجت فجاءتنا امرأة سوداء فقالت إني قد أرضعتكما فأتيت النبي ﷺ فقلت إني تزوجت امرأة فلانة ابنة فلان فجاءتنا امرأة سوداء فقالت إني أرضعتكما وهي كافرة فأعرض عني فأتيته من قبل وجهه فقلت إنها كاذبة فقال لي كيف بها وقد زعمت أنها أرضعتكما دعها عنك
Its isnad is sahih. Ubayd bin Abu Maryam Makki was deemed trustworthy by scholars, though there is some discussion about his memory, and Bukhari narrated from him. The hadith was narrated by Bukhari, 3311, in the Book of Knowledge, chapter on Travelling in Pursuit of a Question, Shaab edition. Also by Abu Dawud, 3/307, no. 363, in the Book of Judgments, chapter on Testimony Concerning Suckling, and by Tirmidhi, 3/448, no. 1151, who said, hasan sahih, and by Nasai, 6/109, no. 3330, and by Darimi, 2/209, no. 2255.