Another vote for magnesium.
Diabetics are known to be more susceptible to cramps than the general population. It can occur with type 1 and type 2 diabetes, but appears to be more prevalent with type 2, possibly because patients with insulin resistance tend to lose magnesium in their urine, contributing to lower levels.
Should you be unfortunate enough to experience another bout of cramps in your legs, whatever you do, don't point your feet! It's a natural reaction, but prolongs the agony. Instead grab your toes and pull upwards towards your knees.
You may want to support your feet in bed with a pillow. I find that simple precaution prevents me from flexing my feet in my sleep.