He borrowed some money, then the lender died, and he does not know any of his relatives
Question

I took a loan from a man, then the man died and I do not know any of his relatives. A long time has passed since that man died. What should I do?
Praise be to Allah.If a person owes a debt to someone else, or he has anything that someone else left as a pledge with him or entrusted to him for safekeeping, and he does not know that person’s heirs after he died, and he has asked and sincerely tried his best to look for them but could not find anyone, then he may give it in charity. For example, he can give it in charity to the poor, or for the upkeep of a mosque, or any other Islamic cause so that the deceased will benefit thereby, on condition that he made the effort and asked about that person’s relatives, but could not find anyone or find someone who could point him in the right direction after he tried hard. In that case, he may give it in charity to the poor, or spend it on the upkeep of a mosque or similar charitable projects. Or if he hands it over to the ruler or the judge in the city, and receives a certificate or document for it, that is sufficient, but spending it on charitable causes is the quickest way to do good and benefit the owner, because he will be rewarded for that. He should give it in charity on his behalf, with that intention.
End quote.
Shaykh ‘Abd al-‘Azeez ibn Baz (may Allah have mercy on him)
Fatawa Noor ‘ala ad-Darb (3/1464).