From Distillers Wiki
The formation of vinegar, usually caused by contamination of the must, liquor or finished product with vinegar-producing bacteria (acetobacter) and the presence of air. Fermentation bottles should be filled as high as the froth or foam caused by fermentation will allow and the topped up as foam production subsides. Stored wine should have no more than one inch of air under the cork in the standing bottle (2/8 to 1/2 inch is preferred). Adding one Campden tablet per gallon may halt acetification in its early stages, when the wine emits a slight smell of vinegar and an acid taste. When the smell of vinegar is strong, however, it is probably too late to save the wine, but you might want to go ahead and make some wine vinegar instead. NEVER make wine in a wooden cask or barrel or plastic primary that has contained vinegar, even if acetification was successfully halted.