Just do light calf stretches before hitting the bed and drink coconut water daily. Also, check with your doctor if you need calcium supplements, as low calcium causes this.
Oh those midnight leg cramps are literally the worst, yaar! Don't stress too much, just keep a hot water bag handy and ask your hubby to gently massage your calves.
My mother told me to massage my legs with warm sesame oil before sleeping. It gave me great relief, but definitely let your doctor know if the pain is very severe.