It's likely your duck has a niacin deficiency, and you just didn't notice the signs early on. It is possible it could be a deformity, like varus-valgus, but it's impossible to tell over the internet. Regardless of the fact, if the bird has had her legs like this for a while, I can speak from my own experience and many others that her bones are likely too hard and set in place to be corrected at this point without dramatic measures like surgery.
The sticky eye you're seeing in his eyes is due to inactivity directly correlated to him not getting around much because of his leg problem. If environmental needs are not satisfied you will begin to see sores developing on the hock area due to excessive pressue, after some time, bacteria will flush in and he will have a bone infection, which is hard to treat. What you might also see come on is wet feather, the inability for her to repel water.
The chances of the conditions mentioned can be greatly reduced by making sure she gets in deep water at least once a day, and misting her feathers often when she's not in water to encourage preening habits. When she is not in water, to prevent sore from developing, keep her on soft padded grounds, that allow cushioning to her feet.
Vitamin supplementation may also be helpful, but it's likely it won't resolve her problem. She needs B3 (niacin) not B12. You can get 500mg niacin capsules and dissolve one in ten gallons every few days, or get Cattle B complex, and give her 1ml a day, over treats, or orally. Flax seeds may help with her legs, and if swelling ever becomes a concern which it often does. An Epsom salt bath may be useful.