Ibrahim (may Allah have mercy on him) said: Jundub and Masruq (may Allah have mercy on them both) caught one rak'ah of the Maghrib prayer. When the imam gave the salam, both stood up to make up (the rest). Jundub stood up in the second rak'ah, while Masruq sat in both of the made-up rak'ahs. Both of them asked Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him), and he said: "Both of you have done well, and I would do as Masruq did."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 9340