Poor guy. I can't really tell, does he have a pain patch on?
If you think he's really uncomfortable you might talk to your vet about having one applied. Fenatnyl [the pain patch] is like 100 times stronger than morphine and lasts I think 3-4 days which could get you over the initial pain hump.
Also our dogs when they stay overnight have moments where they lay on that leg. It isn't good for the dog to only lay on one side, he knows what he's capable of so even though it looks weird/ouchie he knows what he's doing.