aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Sardara <msardara+fdio@cisco.com>2018-06-19 18:22:16 +0200
committerMauro Sardara <msardara+fdio@cisco.com>2018-06-20 09:07:35 +0000
commit7c9ff25dcc00602bf6d63156fe70844c1e97ee30 (patch)
tree4449987f1149a1972ea40a5faa2c02381257f69e
parentede6ab9cf3ecaf1745ae9218e5ad62fed9161383 (diff)
Solved memory leaks in parc_PublicKeySigner.c
Change-Id: Icef730d16a5d0d4e6b077627ae23bd1c4e73996f Signed-off-by: Mauro Sardara <msardara+fdio@cisco.com>
-rw-r--r--libparc/parc/security/parc_PublicKeySigner.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libparc/parc/security/parc_PublicKeySigner.c b/libparc/parc/security/parc_PublicKeySigner.c
index 4122b992..3c70a139 100644
--- a/libparc/parc/security/parc_PublicKeySigner.c
+++ b/libparc/parc/security/parc_PublicKeySigner.c
@@ -186,6 +186,7 @@ static inline int _SignDigestRSA(const PARCCryptoHash *digestToSign, PARCBuffer
sigLength,
rsa);
assertTrue(result == 1, "Got error from RSA_sign: %d", result);
+ EVP_PKEY_free(privateKey);
RSA_free(rsa);
return result;
}
@@ -289,6 +290,7 @@ _GetSignatureSize(PARCPublicKeySigner *signer)
size = RSA_size(rsa);
RSA_free(rsa);
+ EVP_PKEY_free(privateKey);
break;
}
case PARCSigningAlgorithm_ECDSA:
@@ -302,6 +304,7 @@ _GetSignatureSize(PARCPublicKeySigner *signer)
size = ECDSA_size(ec_key);
EC_KEY_free(ec_key);
+ EVP_PKEY_free(privateKey);
break;
}
}