Your prior hip surgery
could play a role, of course, and you should first see an orthopedic surgeon to evaluate the stability of your hip prosthesis
. (most implants last at least ten years; in fact, depending on the type of prosthesis used, your age, gender, weight, and activity level, the chance of a hip replacement
lasting 20 years is around 80%.)
other potential causes for your leg instability include internal knee derangement (e.g., a meniscal tear) or a neurological problem, such as a TIA
(if the leg simply "gives way" without a warning or other symptoms -- numbness
, weakness, tingling
, etc. -- a neurological disorder is unlikely). If your hip proves to be stable, your orthopedist could also determine whether there's anything amiss with your knee. If orthopedic problems are ruled out, see your family doctor to determine the next step in your evaluation.
I hope things work out well!