Sahih Muslim 110 a
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
مَنْ حَلَفَ عَلَى يَمِينٍ بِمِلَّةٍ غَيْرِ الإِسْلاَمِ كَاذِبًا فَهُوَ كَمَا قَالَ وَمَنْ قَتَلَ نَفْسَهُ بِشَىْءٍ عُذِّبَ بِهِ يَوْمَ الْقِيَامَةِ وَلَيْسَ عَلَى رَجُلٍ نَذْرٌ فِي شَىْءٍ لاَ يَمْلِكُهُ "
Thabit b. Dahhak reported that he pledged allegiance to the Messenger of Allah (ﷺ) under the Tree, and verily the Messenger of Allah (ﷺ) observed:
He who took an oath of a religion other than Islam, in the state of being a liar, would became so, as he professed. He who killed himself with a thing would be tormented on the Day of Resurrection with that very thing. One is not obliged to offer votive offering of a thing which is not in his possession.
Full reference and source
Sahih Muslim 110 a In-book : Book 1, Hadith 208 USC-MSA web (English) : Book 1, Hadith 201 (deprecated)
View source on Sunnah.com (opens in a new tab)