Isma'il bin Abdullah bin Ja'far said: It reached me that the Messenger of Allah (peace and blessings be upon him) said: "Any person who is in a gathering and, when he wants to get up, says: 'Subhanaka Allahumma wa bihamdika, la ilaha illa anta, astaghfiruka wa atubu ilayk' (Glory be to You, O Allah, and praise be to You; there is no god but You; I seek Your forgiveness and I turn to You in repentance), whatever happened in that gathering is forgiven for him." I narrated this hadith to Yazid bin Khusayfah, and he said: Sayyiduna al-Sa'ib bin Yazid (may Allah be pleased with him) also narrated this hadith to me from the Messenger of Allah (peace and blessings be upon him) in the same way.
Hadith Referenceالمعجم الكبير للطبراني / باب السين / 6643