Nighttime/nocturnal leg cramps may or may not be related to some other condition, but they are known to be associated with some, like diabetes. Risk of getting/having them increases with age, and treatments can depend on cause. MrsD has a good starting place, but some other trial & error could be in order too. There's a lot of info/suggestions on the web; google: nocturnal leg cramps treatment or since they're more often associated with calves and yours are higher, you might try nocturnal thigh cramps treatment (and check out some of the related searches).
If they seem like the charley horse type, deep massage, going from the extremities toward the heart, usually works for me; I've seen that technique recommended many times through the years.
Dr. Zachary Smith
Oh, the pain... THE PAIN...
Dr. Smith is NOT a medical doctor. He was a character from LOST IN SPACE.
All opinions expressed are my own. For medical advice/opinion, consult your doctor.