Hafetz Haim Halachot
Halacha 135 / 215

Hilchos Lashon Hara chapter 10, section 4

Earlier we said the fifth condition is that your goal must be to help.

This is clearly true if the people you tell can help the person who was robbed, cheated, hurt or shamed.

But even if telling them cannot fix anything, it can still count as helpful. For example, you want people to stay away from evil when they hear that wrongdoers are criticized. And perhaps the wrongdoer himself will hear people criticizing him, regret it, and change his ways. This also counts as a good purpose. You are not trying to enjoy his faults. You simply care about the truth.

But if you expect that there will surely be no benefit, you should not tell. For example, the listeners are bad people who do the same wrongs and think nothing of them. Besides there being no benefit, great harm may come from it. They may go and tell the wrongdoer that you spoke about him. Then they transgress "You shall not go as a talebearer" (Vayikra 19:16). And often a big fight comes out of it.

If telling the story could lead to someone reporting a Jew to the authorities, it is certainly forbidden, even if all the conditions are met.

In all of this, it makes no difference whether the victim asked you for help or not, or whether the victim is your relative. (Many people make a mistake here. They act against a wrongdoer on behalf of a relative even when the facts are not clear. They think they are keeping the mitzvah "Do not hide from your flesh" (Yeshayahu 58:7). This is a mistake.)