That is a slipped tendon, we normally see it in recently hatched chicks and is easily fixed when caught right away. If this has just happened you can fix it but if it has been a week or more the likelihood of fixing it is very low.
Straighten the leg out and press on the right side of the leg (outside) against the tendon, as in the view of your picture. The tendon will press back into the correct placement, the slight groove in the bone joint. Use a short length of tape and wrap from where you pressed the tendon over and around, wrap the tape around the leg in a figure eight holding the tendon in place both above and below. A narrow tape is better than a wide one for this, I cut my tape lengthwise in half.
You will need to hold the leg straight as bending it while it is swollen the tendon will just pop back out. I use a piece of cardboard from a cereal box and make a U-shaped tube and tape it to the leg to keep it held straight. You may have to pad it to support the leg and keep it straight.
The best results are when you remove the splint every day and carefully flex the leg just a little at first but holding your fingers on either side to keep the tendon from slipping back out of place. So, keep the leg straight, pinch either side of the knee to hold the tendon in place and flex the leg slightly and increase the exercise every day until the leg flexes without popping the tendon out of place.
If you can do that the leg will return back to normal. How long it will take depends on the amount of time you dedicate to working the leg every day.
There is a chance that the bird will tear the hock so be aware of the leg turning out from the body. At the first sight of that you will need to immobilize the bird or vet wrap the upper leg to the body. The splinted leg needs to be kept straight back to avoid damaging the hock.
This picture shows the cardboard for a day-old chick. The splint is usually only needed for a day or two at that age. A six week old chick will need something more substantial to keep the leg from bending.
View attachment 3647065