A slave came to the Prophet ﷺ and pledged allegiance to him. Then his master came looking for him and recognized him, so the Messenger of Allah ﷺ bought him from his master and freed him. After that, he would not accept anyone's pledge of allegiance until he had asked whether the person was free or a slave.
حدثنا أبو سعيد مولى بني هاشم حدثنا ليث حدثنا أبو الزبير
جاء عبد إلى النبي ﷺ فبايعه فجاءه مولاه فعرفه فاشتراه رسول الله ﷺ منه فأعتقه ثم لم يكن يبايع أحدا بعد ذلك حتى يسأله حر أو عبد
No references are available.
Its isnad is sahih, it has already appeared at 14708, and its narrators have already been mentioned as well.