methods of inhibiting corrosion comprising providing a corrosive environment ; adding a corrosion inhibitor comprising a reaction product of a thiol compound and an aldehyde compound . methods of acidizing a near well bore region of a subterranean formation comprising isolating a zone of interest along a well bore ; and placing an acidizing solution in the zone of interest wherein the acidizing solution comprises an acid and a corrosion inhibiting compound comprising the reaction product of a thiol compound and an aldehyde compound .