Skip to content
Commit 5d91238b authored by Jarkko Sakkinen's avatar Jarkko Sakkinen Committed by Greg Kroah-Hartman
Browse files

KEYS: trusted: Fix memory leak in tpm2_key_encode()



commit ffcaa217 upstream.

'scratch' is never freed. Fix this by calling kfree() in the success, and
in the error case.

Cc: stable@vger.kernel.org # +v5.13
Fixes: f2219745 ("security: keys: trusted: use ASN.1 TPM2 key format for the blobs")
Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 104ef3d8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment