Prevent legs from coming out of socks
There are four main solutions of varying complexity... you may choose to do all three:


Put a lot of love into weight painting on both the leg and the sock so you don't get intersections on deformation.
Use a mesh deform modifier as part of your rig. If the leg and the sock are both deformed by the mesh deform modifier, there's less likelihood that you'll have intersections.
Use corrective shape keys... if the intersection happens reliably and predictably as the knee bends, you can make a shape key that fixes the intersection. You can then drive the influence of that shape key using the knee's rotation.
Put the sock and the leg on different render layers and make sure the sock layer is always over the leg layer. This may require some clever masking for the back of the, but it's doable.