Yahya related to me from Malik from Talha ibn Abi al-Malik al- Ayli from al-Qasim ibn Muhammad ibn as-Siddiq from A'isha that the Messenger of Allah ﷺ said, "Whoever vows to obey Allah, let him obey Him. Whoever vows to disobey Allah, let him not disobey Him." Yahya said that he had heard Malik say, "The meaning of the statement of the Prophet ﷺ 'Whoever vows to disobey Allah, let him not disobey Him' is that for instance a man who vows that, if he speaks to such-and-such a person, he will walk to Syria, Egypt, or any other such things which are not considered as ibada, is not under any obligation by any of that, even if he did speak to the man or did break whatever it was he swore, because Allah does not demand obedience in such things. He should only fulfill those things in which there is obedience to Allah."
أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ مَنْ نَذَرَ أَنْ يُطِيعَ اللَّهَ فَلْيُطِعْهُ وَمَنْ نَذَرَ أَنْ يَعْصِيَ اللَّهَ فَلاَ يَعْصِهِ۔ إِنْ نَذَرَ أَنْ يَمْشِيَ إِلَى الشَّأْمِ، أَوْ إِلَى مِصْرَ، أَوْ إِلَى الرَّبَذَةِ، أَوْ مَا أَشْبَهَ ذلِكَ مِمَّا لَيْسَ للهِ بِطَاعَةٍ. إِنْ كَلَّمَ فُلَانًا، أَوْ مَا أَشْبَهَ ذلِكَ. فَلَيْسَ عَلَيْهِ فِي شَيْءٍ مِنْ ذلِكَ، شَيْءٌ، إِنْ هُوَ كَلَّمَهُ، أَوْ حَنِثَ بِمَا حَلَفَ عَلَيْهِ، لِأَنَّهُ لَيْسَ للهِ فِي هذِهِ الْأَشْيَاءِ طَاعَةٌ. وَإِنَّمَا يُوَفَّى للهِ بِمَا لَهُ فِيهِ طَاعَةٌ