The same hazard exists for roasted garlic stored in oil. As an alternative, properly prepared dried garlic cloves may be safely added to flavored oils. Place tomatoes in a bowl and sprinkle quickly with distilled white vinegar. Toss the pieces rapidly with your hands, just to moisten lightly. Quickly empty the bowl onto a double layer of paper towels and pat dry.
Pack tomatoes lightly into clean pint or half-pint jars.
Add dried rosemary, sweet basil or oregano, if desired. Reduce the heat to low for two hours. Don't let the oil come anywhere near a simmer. Remove pan from burner and cool for 30 minutes. Pour oil through a fine-meshed sieve that has been lined with multiple layers of cheesecloth, into a clean jar or bottle.