It is narrated from Sayyiduna Abu Umamah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) returned from Khaybar with two slaves. He gave one of them to Sayyiduna Ali bin Abi Talib (may Allah be pleased with him) and said: "Do not beat him, for I have been forbidden from beating those who pray, and I have seen him praying." And he gave a slave to Sayyiduna Abu Dharr (may Allah be pleased with him) and said: "Treat him well." So he freed him. Then the Prophet (peace and blessings be upon him) said: "What became of the slave I gave you?" He said: You ordered me to treat him well, so I freed him.
Hadith Referenceالمعجم الكبير للطبراني / باب الصاد / 8026