كتاب الإمارة
33  
The Book on Government
(32)
Chapter: If a person is killed in the cause of Allah, all his sins will be expiated except debt
(32)
باب مَنْ قُتِلَ فِي سَبِيلِ اللَّهِ كُفِّرَتْ خَطَايَاهُ إِلاَّ الدَّيْنَ ‏‏
Sahih Muslim 1885 b

The tradition has been narrated through a different chain of transmitters on the authority of Abu Qatada who said:

A man came to the Messenger of Allah (ﷺ) while he was on the pulpit and said: Do you think if I am killed in the way of Allah... (except this difference in its beginning, the rest of the tradition is the same as the previous one).
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، وَمُحَمَّدُ بْنُ الْمُثَنَّى، قَالاَ حَدَّثَنَا يَزِيدُ بْنُ هَارُونَ، أَخْبَرَنَا يَحْيَى، - يَعْنِي ابْنَ سَعِيدٍ - عَنْ سَعِيدِ بْنِ أَبِي سَعِيدٍ الْمَقْبُرِيِّ، عَنْ عَبْدِ اللَّهِ بْنِ أَبِي قَتَادَةَ، عَنْ أَبِيهِ، قَالَ جَاءَ رَجُلٌ إِلَى رَسُولِ اللَّهِ صلى الله عليه وسلم فَقَالَ أَرَأَيْتَ إِنْ قُتِلْتُ فِي سَبِيلِ اللَّهِ بِمَعْنَى حَدِيثِ اللَّيْثِ ‏.‏
Reference : Sahih Muslim 1885b
In-book reference : Book 33, Hadith 177
USC-MSA web (English) reference : Book 20, Hadith 4647
  (deprecated numbering scheme)