Would seem like it's possible to get "jock itch". However, was it from the sheath or his actual penis? He could have had ejaculated, geldings are quite capable of arousal and the rest, just not actually fertilizing a mare. If there is a pus like discharge, I would have the vet come sedate and examine thoroughly for a wound or sore that's infected. I've never seen a gelding or stallion with a "yeast infection" personally.
PLEASE have this checked immediately. My mother lost her favorite horse to cancer in the sheath. He had tumors that would pustulate like that. We tried to remove them...chemo...but we still lost him. Get it checked immediately.
If it is a yeast infection, they can get Candida. In that case the vet may suggest something like Vagisil or an Azole anti-fungal, like Monostat. You could also ask your vet about a generic version of the above which will be lots cheaper. OTC brands are expensive.