If you're thinking of botulism -- Clostridium botulinum is anaerobic, but the garlic is both cooked AND exposed to air in storage, so it's less likely.
I don't mean to minimize the very real possibility of food-borne illness; it's just that my experience with roast garlic puree (both at home and at work where we would make 10 to 15 pounds at a time and hold it for several weeks) is one of safe, relatively longterm storage.
Certainly botulism is of vanishingly low risk unless oil is added to the storage, a frequent choice. Cooking only kills active botulinin and safely denatures the toxin if of the proper temperature and duration; the spores are still present and viable.
To me, it's more a matter of what is a generally good safe practice.