Hello, as you have given limited information we cannot pin point identify the reason behind pain , but the pain can be of muscle origin due to poor strength.
Stretching of calf muscles and hamstrings can provide relief along with hot compress over the area before sleeping.
Next Steps
See a general physician if pain persists.
Health Tips
Avoid crossed leg sitting and sleeping on the affected side till the pain subsides.
Try changing the mattress if it is not comfortable enough.