كتاب الصيام
18  
Fasting

Yahya related to me from Malik from Hisham ibn Urwa from his father that Hamza ibn Amr al-Aslami once said to the Messenger of Allah, may Allah bless him and grant him peace, "Messenger of Allah, I am a man who fasts. Can I fast when travelling?" The Messenger of Allah, may Allah bless him and grant him peace, said, "If you want you can fast, and if you want you can break the fast."

وَحَدَّثَنِي يَحْيَى، عَنْ مَالِكٍ، عَنْ هِشَامِ بْنِ عُرْوَةَ، عَنْ أَبِيهِ، أَنَّ حَمْزَةَ بْنَ عَمْرٍو الأَسْلَمِيَّ، قَالَ لِرَسُولِ اللَّهِ صلى الله عليه وسلم يَا رَسُولَ اللَّهِ إِنِّي رَجُلٌ أَصُومُ أَفَأَصُومُ فِي السَّفَرِ فَقَالَ لَهُ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ إِنْ شِئْتَ فَصُمْ وَإِنْ شِئْتَ فَأَفْطِرْ ‏"‏ ‏.‏
USC-MSA web (English) reference : Book 18, Hadith 24
Arabic reference : Book 18, Hadith 658