It is narrated from Sayyiduna Abu Darda (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: The example of one who frees (a slave) at the time of death is like that of a man who gives a gift after he is full.
Benefits: … Although it is permissible to give charity (sadaqah) or make a bequest (wasiyyah) of up to one third of one’s wealth at the time of death, it is more virtuous to give charity when a person is healthy and desirous (of wealth), wishing for affluence and fearing poverty.