The use of a branched polyester selected from the group consisting of i) a branched polyester polyamine formed by reaction of A) a polycarboxylic acid having 3 or 4 carboxylic acid groups, or a reactive derivative thereof, with B) a monocarboxylic acid having the formula R 1 COOH wherein R 1 is an alkyl or alkenyl group having from 6 to 28 carbon atoms, or a reactive derivative thereof, and C) an alkanolamine having the formula wherein R 2 is a straight or branched chain alkyl residue having from 1 to 24 carbon atoms, an alkenyl residue having from 2 to 24 carbon atoms or a polyoxyalkylene residue of the formula -(D-O) z -R 3; R 3 is hydrogen, an alkyl group having 1 to 18 carbon atoms or an acyl group having 2 to 18 carbon atoms; A, B, D independently from each other are a C 2 - to C 4 -alkylene group or a mixture of those; x, y, z independently from each other are integers from 1 to 20; ii) a branched polyester quaternary ammonium compound obtainable by quaternization of the branched polyester polyamine i); and iii) a mixture of branched polyester polyamine (i) and branched polyester quaternary ammonium compound (ii) as a corrosion inhibitor. i) a branched polyester polyamine formed by reaction of A) a polycarboxylic acid having 3 or 4 carboxylic acid groups, or a reactive derivative thereof, with B) a monocarboxylic acid having the formula R 1 COOH wherein R 1 is an alkyl or alkenyl group having from 6 to 28 carbon atoms, or a reactive derivative thereof, and C) an alkanolamine having the formula wherein R 2 is a straight or branched chain alkyl residue having from 1 to 24 carbon atoms, an alkenyl residue having from 2 to 24 carbon atoms or a polyoxyalkylene residue of the formula -(D-O) z -R 3; R 3 is hydrogen, an alkyl group having 1 to 18 carbon atoms or an acyl group having 2 to 18 carbon atoms; A, B, D independently from each other are a C 2 - to C 4 -alkylene group or a mixture of those; x, y, z independently from each other are integers from 1 to 20; A) a polycarboxylic acid having 3 or 4 carboxylic acid groups, or a reactive derivative thereof, with B) a monocarboxylic acid having the formula R 1 COOH wherein R 1 is an alkyl or alkenyl group having from 6 to 28 carbon atoms, or a reactive derivative thereof, and C) an alkanolamine having the formula wherein R 2 is a straight or branched chain alkyl residue having from 1 to 24 carbon atoms, an alkenyl residue having from 2 to 24 carbon atoms or a polyoxyalkylene residue of the formula -(D-O) z -R 3; R 3 is hydrogen, an alkyl group having 1 to 18 carbon atoms or an acyl group having 2 to 18 carbon atoms; A, B, D independently from each other are a C 2 - to C 4 -alkylene group or a mixture of those; x, y, z independently from each other are integers from 1 to 20; R 2 is a straight or branched chain alkyl residue having from 1 to 24 carbon atoms, an alkenyl residue having from 2 to 24 carbon atoms or a polyoxyalkylene residue of the formula -(D-O) z -R 3; R 3 is hydrogen, an alkyl group having 1 to 18 carbon atoms or an acyl group having 2 to 18 carbon atoms; A, B, D independently from each other are a C 2 - to C 4 -alkylene group or a mixture of those; x, y, z independently from each other are integers from 1 to 20; ii) a branched polyester quaternary ammonium compound obtainable by quaternization of the branched polyester polyamine i); and iii) a mixture of branched polyester polyamine (i) and branched polyester quaternary ammonium compound (ii)