Jabir bin Abdullah reported,

A slave came and pledged allegiance to the Prophet ﷺ for the Hijrah, and the Prophet ﷺ did not realize that he was a slave. Then his master came seeking him, and the Prophet ﷺ said, "Sell him to me." So he bought him in exchange for two black slaves. After that, he would not accept the pledge of allegiance from anyone without first asking whether he was a slave.

Ibn Majah 2869

Sahih

حدثنا محمد بن رمح أنبأنا الليث بن سعد عن أبي الزبير

عن جابر قال

جاء عبد فبايع النبي ﷺ على الهجرة ولم يشعر النبي ﷺ أنه عبد فجاء سيده يريزه فقال النبي ﷺ بعنيه فاشتراه بعبدين أسودين ثم لم يبايع أحدا بعد ذلك حتى يسأله أعبد هو

ابن ماجه 2869صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Jihad
Chapter
Pledge of allegiance
Numbering
Darussalam 2869
Ibn Majah 2869