Cloves are used as a preservative since centuries to preserve food. Because of cloves high in antimicrobial, antifungal, antioxidant, and antilarval properties, they are suitable for preservation.
Source: enotes.com