mirror of
https://github.com/stefanberger/libtpms
synced 2026-08-12 23:39:40 +00:00
tpm2: Helpers: Fix a possible memory leak
Fix a possible memory leak that may occur in case of a failure in ObjectGetPublicParameters. The already allocated dP, dQ, and qInv need to be freed. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
daa2dbdc4d
commit
22bb8db8e6
@ -867,7 +867,7 @@ InitOpenSSLRSAPrivateKey(OBJECT *rsaKey, // IN
|
||||
TPM_RC retVal;
|
||||
|
||||
if (ObjectGetPublicParameters(rsaKey, &N, &E) != 1)
|
||||
return TPM_RC_FAILURE;
|
||||
ERROR_EXIT(TPM_RC_FAILURE);
|
||||
|
||||
if(!rsaKey->attributes.privateExp)
|
||||
CryptRsaLoadPrivateExponent(&rsaKey->publicArea, &rsaKey->sensitive,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user