Bring the vinegar to a boil in a small, non-reactive pot, and mix in sugar until dissolved. Reduce heat to low, simmer 5 minutes, and remove from heat. Mash the garlic and salt into a smooth paste, and mix into the pot. Stir in the red pepper flakes. Cool to room temperature before using, or store up to 2 days in the refrigerator.