If you're sitting down when you get a leg cramp, stand up right away and walk around. I know that sounds silly, but it'll make the cramp go away. For the ones you get in your sleep; if you wake up in time, get out of bed and walk around. If not; well, you'll have to just ride it out.
