For the last few months, I have suffered from the above problem. When I stand up, my right leg seems to lock so that it is not fully extended - upper leg and lower leg are at an angle of about 140 degrees.
After a while (sometimes over 5 minutes), the leg mysteriously frees itself and I can walk normally, but trying to "force the issue" is impossible due to the excruciating pain to the groin area that the slightest attempt brings.
Having said all this, when the leg is "normal", I don't have a problem and can go on a 5 mile run or play 2 hours of tennis. However, physical exertion such as this does increase the likelihood of the problem occuring and the length of time before the leg is "freed" again. On days when I don't exercise, the problem is still apparent, but not as severe.
I am currently seeing a physiotherapist who I know from past experience to be very good at her job, but I do not believe that the exercises she is giving me are really doing any good.
I do not think that it can be bone related, given my sporting activity so, by process of elimination, I am thinking that it must be ligament or soft tissue related (although there was no initial trauma) or, maybe more likely, some kind of trapped nerve problem.