Find a piece of pipe that is very similar to the outside diameter of the bolt. Slide over bolt, and SLOWLY AND CAREFULLY bend straight. You could PROBABLY get away with using pliers, but you might damage the thread.
Put the nut on and screw it all the way to the leg before bending the bolt. That way, if you do accidentally damage the thread you are better able to force it back into shape by unscrewing the nut with a spanner.