Al-Hakam (may Allah have mercy on him) narrates from Qadi Shurayh (may Allah have mercy on him): If the mukatab dies while owing a debt, the payment of the debt should come first.