Hilchos Lashon Hara chapter 6, section 3
The reader should not wonder: "If it is forbidden to hear bad things about others, how can a person do the right thing? How can he check out a business partner?"
The answer: someone who wants to do the right thing should act like this. If a person comes to tell him something bad about someone, he should ask him whether this will help him with something in the future. If the speaker says it will help, he may listen, but not believe. He may only treat it as a warning and be careful. But if he understands from the answer that it is just insults and curses, and that the speaker is making up accusations out of hatred, it is forbidden even to listen.