I had these all the time as a kid and sometimes get them till this day... stretch before bedtime or before sitting in a position for a long time, stretching is the cure, if he is having a muscle spasm atm have him stretch his leg as straight as possible, it may seem very painfull to do that, but it will stop it.
I generally used to get them at night.
_________________
The clown stays sad.
The ground stays hard.
With a couple pounds of migraine, a pocket full of scars.
But the face stays painted on for everyone to gaze upon
continuing the bad dream till he wakes up gone.