1) If someone is in a critical criminal case can someone, to protect himself from prosecution(without legally harming anyone else) speak Loshon Hara or rechilos about others, including members of ones family who are connected to the case? 2) Can one speak loshon harah to a therapist to ease his pain concerning that person? 3) Can one speak loshon harah to a Rav or friend to ease his pain concerning that person? 4) Can one speak loshon harah or rechilas about a niftar for his legal case?
ב"ה Shalom The chafetz Chaim in his sefer part I, chapter 10 speaks about the cases in which one is allowed to speak Lashon Hara. In general, one may speak lashon Hara to protect someone else who was hurt by a wrongful doing by someone who did nothing to correct the wrong doing when the intention of the person saying what was done is for beneficial reasons but not to enjoy besmirching somebody else . However, this permit to say lashon hara is limited to seven restrictions.1. That what is said was actually seen by the person and not heard from others. 2. The action must be scrutinized and thought about that what was seen was actually a wrongdoing. 3. The sinner must have been warned first in a soft manner so that maybe he would mend his ways.4.The wrongdoing should not be exaggerated 5. As said above it should be with good intentions and not to enjoy besmirching somebody else 6. If the benefit can be brought about without having to speak lashon hara. 7. That the harm stemming from the lashon hara should not be more than what would happen to the person if properly testified upon in a Bet Din. Having said all this, since what you're describing seems complex, you should consult a Rabbi face to face with all the details. However, in regard to saying lashon Hara to ease one's emotional pain, one may speak to someone else with same reservations as mentioned above. (see הלכות לשון הרע כלל י, סעיף יד, ספר חסידים ((מרגליות סי' סד). All the best. חג כשר ושמח