Catholic priests are forbidden from revealing anything they learn in confession under ANY circumstances. If someone comes in and confesses to a crime or that they are planning a crime, the priest can advise them to go to the police, they can counsel them that they may be in danger of hellfire if they do not, but they absolutely cannot tell anyone. The Catholic Church takes this very seriously. It is fully expected that a priest would die rather than break the confidentiality of confessions.
The Catholic Church is made up of people and people do all kinds of things and make all kinds of choices in life. As others have pointed out, it's very possible to talk about the struggles of your community without calling out Bob in the third row.