Okay, from one naturally protective and territorial guy to another. . .
First off: Chill the fuck out.
Second: Explain this flirtation.
Third: If it is actually flirting and not just friendly banter, do not get all whiny and lay yourself at her feet over it.
Fourth: You probably will not win if it comes down to you or her friend. Most women are very particular with their friends and if you start telling her to stop being so friendly with him, she's as likely to either get mad and start doing it more out of rebellion as she is to nod and smile and agree. You aren't the boss of her.
Fifth, a comment here and there to show her you aren't particularly appreciative of the flirting should do the job if she isn't a bitch and cares about your relationship. She may be doing it because she wants you to fight for her, she may be doing it cause she likes flirting, either way a little nudge now and again should get things moving in the right direction if she isn't doing it on purpose.
Sixthly or whatever I'm up to: Do not show all your cards to the guy. If he IS trying to take your woman, it will just give him more ammo to use against you. If he isn't, he might tell her just as a friend and cause a bunch of drama over your interference with her life.
And don't worry so much. I know it is hard but if she is with you, she is sleeping with you at night, buying you an ugly tie for christmas, or whatever. . . she is with you because she wants to be. Unless you're supporting her or otherwise giving her a good reason to be using you, she probably isn't just hanging around for the company.
Chill out. Turn the alpha-male down a few clicks and remember a relationship is a mutual thing and not something you can force. If she wants out she will get out, if she doesn't she isn't going anywhere and, in the wretched case that it happens, she won't be fucking this guy for any other reason than she wants to.
Good day sir.