The Messenger of Allah ﷺ said, "While a man was walking along a road, he found a thorny branch lying in the way and removed it. Allah was grateful to him for that and forgave him." He also said, "The martyrs are five: the one who dies of plague, the one who dies of an abdominal illness, the one who drowns, the one killed by a collapsing structure, and the one martyred in the cause of Allah."Then he mentioned the hadith about the merit of the first row in congregational prayer.
أن رسول الله ﷺ قال: بينما رجل يمشي بطريق إذ وجد غصن شوك على الطريق، فأخره فشكر الله له، فغفر له وقال: الشهداء خمسة: المطعون، والمبطون، والغرق، وصاحب الهدم، والشهيد في سبيل الله. ثم ذكر حديث فضل الصف الأول في صلاة الجماعة.
Malik narrated it in the chapter on prayer in congregation (6), from Sumayy, the freed slave of Abu Bakr bin Abdul-Rahman, from Abu Salih, from Abu Hurairah, and he mentioned it.Bukhari narrated it in the chapter on jihad and expeditions (2829), and Muslim in the chapter on leadership (1914:164), both of them through the route of Malik, with the same chain. Muslim mentioned it in full, while Bukhari, in this place, limited himself to the hadith about the martyrs.The hadith of Jabir bin Utaik Ansari will come, in which it says, "The martyrs are seven, besides being killed in the path of Allah."The two can be reconciled, for revelation first came to him regarding five, then revelation came to him regarding seven.