It's the lack of air + botulism spores + time to mature that causes poisoning. I believe it slows things down when it's in the fridge, but I can't imagine it's a foolproof method. Your chances of getting sick are probably very small if you consume it quickly, but there is still a risk. Raw onions, raw garlic, etc pose no risk whatsoever, because they're exposed to air. However, if you canned them improperly or covered them completely with oil (like a lot of people do with garlic) without acid/heat, there is a risk.
The following is an excerpt from this site:
http://cecalaveras.ucdavis.edu/garlic.htm
STORING GARLIC IN OIL
Extreme care must be taken when preparing flavored oils with garlic or when storing garlic in oil. Peeled garlic cloves may be submerged in oil and stored in the freezer for several months. Do not store garlic in oil at room temperature. Garlic-in-oil mixtures stored at room temperature provide perfect conditions for producing botulism toxin (low acidity, no free oxygen in the oil, and warm temperatures). The same hazard exists for roasted garlic stored in oil. At least three outbreaks of botulism associated with garlic-in-oil mixtures have been reported in North America.
By law, commercially prepared garlic in oil has been prepared using strict guidelines and must contain citric or phosphoric acid to increase the acidity. Unfortunately, there is no easy or reliable method to acidify garlic in the home. Acidifying garlic in vinegar is a lengthy and highly variable process; a whole clove of garlic covered with vinegar can take from 3 days to more than 1 week to sufficiently acidify. As an alternative, properly dried garlic cloves may be safely added to flavor oils.