As stated above, disclosure of an item told in confidence is prohibited as avak rechilus (see Day 136). An extremely sensitive area not discussed in the Sefer Chofetz Chaim is that of disclosing confidential information for a constructive purpose.
It is obvious however, that if halachah requires a person to disclose a matter to a particular individual and he discloses it to a different person instead, while insisting that it remain confidential, his wishes should not be respected. If, for example, a person involved in a shidduch (marriage match) confides in a friend that he suffers from a chronic serious ailment, it is the responsibility of the friend to ensure that the other party is informed. One cannot demand confidentiality when the Torah requires him to disclose such information.
A second situation where it is clear that one must reveal a secret that has been shared with him is where one has been told by a person of his secret plan to harm someone. One cannot demand confidentiality in order to harm others.