It is narrated from Sayyiduna Abu Qatadah (may Allah be pleased with him): A man came to the Prophet (peace and blessings of Allah be upon him) and said, "O Messenger of Allah (peace be upon him)! What do you think, if I fight with my sword in the way of Allah, being patient, with pure intention, facing the enemy and not fleeing, will my sins be forgiven?" The Prophet (peace be upon him) said, "Yes." When the man turned back (the Messenger of Allah, peace be upon him, called him again) and said: "Jibreel (peace be upon him) has come and said: Except if you are in debt."
Hadith Referenceالسنن المأثورة / باب الجهاد / 646
Hadith Takhrijصحیح مسلم، الامارہ، باب من قتل فی سبیل اللہ کفرت خطایاہ الا الدین، رقم: 1885۔