The Messenger of Allah ﷺ saw a man being supported between his two sons.He asked, "What is the matter with him?"They replied, "He has vowed to walk."The Messenger of Allah ﷺ said, "Allah has no need for this man to torment himself." He then ordered him to ride.
حدثنا ابن أبي عدي عن حميد
رأى رسول الله ﷺ رجلا يهادى بين ابنيه قال ما هذا قالوا نذر أن يمشي فقال رسول الله ﷺ إن الله عز وجل لغني أن يعذب هذا نفسه فأمره فركب
Its isnad is sahih. Bukhari related it, 8/177, in the Book of Oaths, in the chapter on vowing what one does not own, Abu Dawud, 3/235 no. 3301, in the Book of Vows, in the chapter on one who vows to walk, Tirmidhi, 4/111 no. 1537, and Nasai, 7/30 no. 3852.