hi, thanks for the question
Knee giving away following injury is a feature of ligament injury
in the knee. most problable the ACL.
It needs proper clinical evaluation and if required an MRI
scan. The swelling of the leg is due to soft tissue
edema which will reduce with rest , limb elevation and cold