The fungus Ustilago violacea is dispersed between certain caryophyllaceous plants, including Lychnis viscaria, by pollinating insects. Infection leads to sterility the following season when the infected plant produces fungal spores instead of pollen. Attraction of pollinators is thus associated not only with the cost of producing flowers but also with a risk of becoming infected by the fungus. In this paper I analyse male lifetime reproductive success as a function of incidence of infection in a population, cost of flower production and attractiveness to pollinators (measured as size of the inflorescence)