No, the knees should not be locked out.* See caveat.
The two primary reasons:
Once the knees are locked all the weight is transferred directly to the joint, which can be disasterous
Not locking out increases the time under tension.
With appropriate loading and a controlled lift the risk of injury is relatively low.
There's two aspects: the joint ...