It was narrated from ‘Imran bin Husain that a man freed six slaves of his when he was dying, and he did not have any wealth apart from them. News of that reached the Prophet and he was angry about that. He said: “I was thinking of not offering the funeral prayer for him.” Then he called the slaves and divided them into three groups. He cast lots among them, then freed two and left four as slaves. (Sahih)