IF there was a leak in the sanitation plumbing the boat would smell all the time, not just when flushing.
If the holding tank vent line were clogged, then flushing and pumping out would be a problem, however odors when flushing would not.
When you put a gallon of fluid in a tank, a gallon of air needs to be displaced. This occurs through the holding tank vent. If you're getting odor when flushing specifically, then install a holding tank vent filter and change it every 6 months.
https://defender.com/en_us/dometic-d...idge-309311004