Ask a non-assertive question rather than pointing out errors
I agree with user2705196's answer, but will refine it a bit:
When relevant Instead of saying something like
Professor, I think you were wrong to state that X, it's actually Y because Z.
try:
Professor, can you elaborate a bit on how X agrees with Z?
this way - if you got it wrong, they'll explain it (and it would still help other students, who might have the same misconception as you); and if you got it right, there's a good chance the response would be "Oh, Z? It should be Y, sorry" - and then the Professor has corrected himselfhis/herself.