It may be an inflamed facet joint. Go and see an osteopath. The pain in your leg is referred pain from your back (obviously) and you will continue to get it unless you get back treated.
Or a trapped nerve which only pinches occasionally - again need an osteopath IMO. But then I go to the osteo at the drop of a hat as he is fun and gorgeous and massages my buttocks....
Heh heh!