Aisha reported that the Prophet ﷺ entered upon her while a man was with her. He asked, "Who is this?"She replied, "He is my brother through breastfeeding."He said, "Be careful about whom you admit into your presence, for breastfeeding establishes kinship only when it satisfies hunger."
حدثنا أبو بكر بن أبي شيبة حدثنا وكيع عن سفيان عن أشعث بن أبي الشعثاء عن أبيه عن مسروق
أن النبي ﷺ دخل عليها وعندها رجل فقال من هذا قالت هذا أخي قال انظروا من تدخلن عليكن فإن الرضاعة من المجاعة
Reported by Bukhari, Testimonies, Chapter on Testimony Regarding Lineage, Well-Known Breastfeeding, and Death of Long Ago, no. 2647, and Muslim, Breastfeeding, Chapter on Breastfeeding Being Only from Hunger, no. 1455, from the hadith of Sufyan through the same chain.