Lots of answers that seem to be divided into 2 camps.
1. Walk away now, as fast as you can. Maybe even sneak out during the prayer because this preacher isn't preaching Moses! (Oops! That wasn't quite what someone said, but he says it enough elsewhere, it seemed relevant!)
2. Go to the person first. Tell them your concerns. If they don't listen, then leave.
But, what does the Bible say? I guess it would depend upon whether you agreed with the idea that preaching bad doctrine is sin. I think most people would agree with that. If not, carry on! So, the Bible:
"“If your brother sins, go and show him his fault when the two of you are alone. If he listens to you, you have regained your brother. 16 But if he does not listen, take one or two others with you, so that at the testimony of two or three witnesses every matter may be established. 17 If he refuses to listen to them, tell it to the church. If he refuses to listen to the church, treat him like a Gentile or a tax collector." Matt 18:1517
So, show him alone, show him in the presence of 2 or 3 witnesses. I confess, I fall short of that biblical standard, and 2 pages into this thread, so does everyone else, from what I read.
I do agree that having someone preaching false doctrine is wrong. Our new preacher is an open theist. I know this, because he told me. I have yet to heard him preach it yet. In fact, he is a very Biblical preacher. Maybe because he knows that I am watching him like a hawk, along with many others, and I will go to him alone, and then before the elder board, if he ever preaches open theism in my church. And if he wasn't rebuked, I would leave.
But, people, let us look at what the Bible says first, instead of all these chatty stories that have more to do with opinions and grievances and probably hurts, than following what the Bible sets point for us to do in these circumstances.