We don't generally give medical advice on this site - But from a nursing standpoint you might try a cushion to keep her legs in a central position on the bed. You can use those big body pillows and the cushions can be purchased relatively cheaply over the internet or at a larger chain drug store. If she is an "active" sleeper you may want to talk to her doctor about restless leg syndrome. Also one or more of her medications may be contributing to the leg movement so again talk to her Doctor.
Peace and Namaste
Hppy