Controlled release of anti-moulding agents in cosmetic formulations