pull someone's chestnuts out of the fire

From Wiktionary, the free dictionary