Hadith.5528 - Ibn Abi Umayr narrated from Jamil ibn Darraj from Abu Abdullah (as), regarding a man who freed his slave at the time of his death while he had a debt upon him.
Imam (as) said
"If the value of the slave is equal to the amount of debt he owes or more, then his emancipation is valid; otherwise, it is not valid."