Sayyidina Jabir (RA) narrated that a slave came to the Prophet (SAW) and offered pledge of allegiance on hijrah (migration). The Prophet did not perceive that he was a slave. His master came, and the Prophet said to him, “Sell him to me.” So, he bought him against two black slaves and thereafter he did not accept anyone’s pledge of allegiance till he had asked if he was a slave.
[Muslim 1602]