The Prophet ﷺ saw a man being supported between two others and asked, "What is the matter with this man?"They replied, "He vowed to walk to the House of Allah."The Prophet ﷺ said, "Allah has no need for this man to torment himself. Tell him to ride."
أخبرنا إسحق بن إبراهيم قال أنبأنا حماد بن مسعدة عن حميد عن ثابت
رأى النبي ﷺ رجلا يهادى بين رجلين فقال ما هذا قالوا نذر أن يمشي إلى بيت الله قال إن الله غني عن تعذيب هذا نفسه مره فليركب
Bukhari narrated it in the Book of Penalty for Hunting, Chapter of One Who Vows to Walk to the Kaaba, hadith no. 1865, and Muslim, in the Book of Vows, Chapter of One Who Vows to Walk to the Kaaba, hadith no. 1642, from the hadith of Humayd Tawil, through this route.