p-methoxy benzylidene malonitrile (MN1) and p-hydroxy benzylidene malonitrile (MN2) were synthesized and tested as inhibitors for the corrosion of mild steel in molar HCl. We have found that both of them inhibit the corrosion. The maximum inhibition efficiency reached 100% for MN1 at 10-4 M and for MN2 at 10-3 M. Current-voltage curves indicated that malonitriles act as mixed type inhibitors. Their adsorption on the steel surface obeys to the Langmuir isotherm model. The effect of temperature on the corrosion behaviour of steel indicated that the inhibition efficiency of the two inhibitors decreases slightly with the rise of temperature in the range 298-338 K. The apparent activation energies for steel dissolution are greater than in the absence of inhibitors, which is consistent with a chimisorption mechanism.