Yahya related to me from Malik from Ibn Shihab from Ubaydullah
ibn Abdullah ibn Utba ibn Masud from Abdullah ibn Abbas that the
Messenger of Allah, may Allah bless him and grant him peace, left for
Makka in Ramadan during the year of the conquest, and fasted until he
reached al-Kadid. He then broke the fast, and so everyone else did so
as well. What people used to do was act according to whatever the
Messenger of Allah, may Allah bless him and grant him peace, had done
most recently.
Muwatta Malik Book 18, Hadith 23