Abu Hudhaifa bin ʿUtba bin Rabiʿa bin ʿAbdi Shams who had witnessed the battle of Badr along with the Prophet ﷺ adopted Salim as his son, to whom he married his niece, Hind bint Al-Walid bin ʿUtba bin Rabiʿa; and Salim was the freed slave of an Ansar woman, just as the Prophet ﷺ had adopted Zaid as his son. It was the custom in the Pre-lslamic Period that if somebody adopted a boy, the people would call him the son of the adoptive father and he would be the latter's heir. But when Allah revealed the Divine Verses: 'Call them by (the names of) their fathers . . . your freed-slaves,' (33.5) the adopted persons were called by their fathers' names. The one whose father was not known, would be regarded as a Maula and your brother in religion. Later on Sahla bint Suhail bin ʿAmr Al-Quraishi Al-ʿAmiri-- and she was the wife of Abu- Hudhaifa bin ʿUtba--came to the Prophet ﷺ and said, "O Messenger of Allah ﷺ! We used to consider Salim as our (adopted) son, and now Allah has revealed what you know (regarding adopted sons)." The sub-narrator then mentioned the rest of the narration. (Using translation from Bukhārī 5088)
أَنَّ أَبَا حُذَيْفَةَ بْنَ عُتْبَةَ بْنِ رَبِيعَةَ بْنِ عَبْدِ شَمْسٍ وَكَانَ مِمَّنْ شَهِدَ بَدْرًا مَعَ رَسُولِ اللهِ ﷺ تَبَنَّى سَالِمًا وَأَنْكَحَهُ ابْنَةَ أَخِيهِ وَهِيَ هِنْدُ بِنْتُ الْوَلِيدِ بْنِ رَبِيعَةَ وَهُوَ مَوْلًى لِامْرَأَةٍ مِنَ الْأَنْصَارِ كَمَا تَبَنَّى رَسُولُ اللهِ ﷺ زَيْدًا وَكَانَ مَنْ تَبَنَّى رَجُلًا فِي الْجَاهِلِيَّةِ دَعَاهُ النَّاسُ إِلَيْهِ وَوَرِثَ مِيرَاثَهُ حَتَّى أَنْزَلَ اللهُ فِي ذَلِكَ {ادْعُوهُمْ لِآبَائِهِمْ هُوَ أَقْسَطُ عِنْدَ اللهِ فَإِنْ لَمْ تَعْلَمُوا آبَاءَهُمْ فَإِخْوَانُكُمْ فِي الدِّينِ وَمَوَالِيكُمْ} [الأحزاب 5] فَرُدُّوا إِلَى آبَائِهِمْ فَمَنْ لَمْ يُعْلَمْ لَهُ أَبٌ كَانَ مَوْلًى وَأَخًا فِي الدِّينِ