It is narrated from Humaid bin Qais and Thawr bin Zaid that the Messenger of Allah, peace and blessings be upon him, saw a man standing in the sun. The Prophet, peace and blessings be upon him, asked about the reason for this. People said: He has vowed that he will not speak to anyone, will not take shade, will not sit, and will remain fasting. The Prophet, peace and blessings be upon him, said: "Order him to speak, to come into the shade, to sit, and to complete his fast."
Imam Malik, may Allah have mercy on him, said: I have not heard that the Messenger of Allah, peace and blessings be upon him, ordered expiation for this; rather, he, peace and blessings be upon him, said that one should complete what is an act of worship and abandon what is bad.
Hadith Referenceموطا امام مالك رواية يحييٰ / كتاب النذور والأيمان / 1015