We don’t know if his spouse, even if they were not considered to be in a valid marriage, confessed before she died. She might have confessed all her sins and received absolution and Holy Communion on her deathbed (if she was Catholic, of course).
That means that she was free of sins when she died and at peace with God.
That man have lost a person he loved very much, married or not. He must be devastated and in deep sorrow and need all the care and comfort we can give. Not to console him and send condolence cards and so on, and say that the reason why is because the woman that died was his illicit mistress may cause him to turn away from the Church all together.
Now he may be reconciled with God and the Church, because of the love and care from his fellow Christians.