The Messenger of Allah ﷺ said, "Every deceased person has their deeds sealed at death, except for the one who guards the frontier in Allah's cause. His deeds continue to grow for him until the Day of Resurrection, and he is granted safety from the trial of the grave."
حدثنا سعيد بن منصور حدثنا عبد الله بن وهب حدثني أبو هانئ عن عمرو بن مالك
أن رسول الله ﷺ قال كل الميت يختم على عمله إلا المرابط فإنه ينمو له عمله إلى يوم القيامة ويؤمن من فتان القبر
[Its chain of transmission is sahih] Tirmidhi narrated it in "the Merits of jihad," in the chapter on what has been said about the merit of one who dies while stationed on the frontier, hadith no. 1621, from the hadith of Abu Hani through this route, and he said, hasan sahih. Ibn Hibban also graded it sahih, hadith no. 1624, as did Hakim, who said it meets the criteria of Muslim, 2/79, and Dhahabi agreed with him.