Hazrat Amr bin Shu'ayb (may Allah have mercy on him) reports from his father, from his grandfather (may Allah be pleased with him), that al-As bin Wa'il made a bequest that a hundred slaves be freed on his behalf. His son Hisham (may Allah be pleased with him) freed fifty slaves, and his other son Amr (may Allah be pleased with him) also intended to free the remaining fifty slaves, and said: "Let me first ask the Messenger of Allah (peace and blessings be upon him)." He came to the Prophet (peace and blessings be upon him) and said: "O Messenger of Allah (peace and blessings be upon him)! My father made a bequest that a hundred slaves be freed on his behalf; Hisham has freed fifty, and fifty remain. Shall I free them on his behalf?" The Messenger of Allah (peace and blessings be upon him) said: "If he was a Muslim, then free slaves on his behalf, or give charity, or perform Hajj, and it will reach him."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الوصايا / 12637