I made a flavoured oil recently to keep about my kitchen and found out the rules about flavored oils after, glad I did. I've only been using this oil for about two weeks, I researched the topic before posting it up here to avoid contracting foot in mouth disease. Despite what you may think flavored oils are not simply created by adding some raw ingredients to olive oil and letting those ingredients slowly infuse their flavors. In fact leaving raw garlic or chili's in oil at room temperature has about the same effect on the vegetables as leaving them out on the counter to rot. The rotting can produce bacteria or mold that you're probably not interested in ingesting.
A restaurant in Stratford ON I recently visited served olive oil with chili flakes in it alongside their gourmet pizzas. It's nice to have a spicy oil to drizzle over a slice of good pizza so I thought I'd do the same thing at home and dumped some chili's about a quarter cup into a small bottle with a pour spout topper and added about a cup or two of olive oil. Flavour wise it worked, after a couple days of infusing the oil took on some of the chili's colour and a lot of the spice; however, safety wise not so much success. What you should do is add the chili flakes and the oil to a pot with a pour lip and heat the oil, not to the point of boiling, you're just trying to kill any bacteria that may be present; give the oil enough time to take on some of the chili's colour. Add your infused oil to a incredibly clean and dry oil bottle with a seal-able pour spout topper. Don't make a huge amount of oil unless you're going to use it quickly, the shelf life should be from 2-4 weeks and I advise you to keep it in your fridge until you're ready to use.