Sayyiduna Abu Hurayrah (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) said: "A man swears an oath and then makes an exception within himself." He said: "That counts for nothing until the exception is made openly, just as the oath is made openly."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الأيمان / 19932