summaryrefslogtreecommitdiffstats
path: root/ssl/ssl_rsa.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>1999-02-15 21:05:21 +0000
committerDr. Stephen Henson <steve@openssl.org>1999-02-15 21:05:21 +0000
commita8236c8c322101c273d14c62282f264555e147c4 (patch)
tree6ec0e1acab729eac8ae5a1f7dd26428c4cf7a9ee /ssl/ssl_rsa.c
parent1750ebcba914d87602007447433529f871d088f5 (diff)
Fix various memory leaks in SSL, apps and DSA
Diffstat (limited to 'ssl/ssl_rsa.c')
-rw-r--r--ssl/ssl_rsa.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ssl/ssl_rsa.c b/ssl/ssl_rsa.c
index a8a62f1b04..745a8ec24f 100644
--- a/ssl/ssl_rsa.c
+++ b/ssl/ssl_rsa.c
@@ -229,8 +229,10 @@ EVP_PKEY *pkey;
if (c->pkeys[i].x509 != NULL)
{
- EVP_PKEY_copy_parameters(
- X509_get_pubkey(c->pkeys[i].x509),pkey);
+ EVP_PKEY *pktmp;
+ pktmp = X509_get_pubkey(c->pkeys[i].x509);
+ EVP_PKEY_copy_parameters(pktmp,pkey);
+ EVP_PKEY_free(pktmp);
ERR_clear_error();
#ifndef NO_RSA
@@ -503,6 +505,7 @@ X509 *x;
if (i < 0)
{
SSLerr(SSL_F_SSL_SET_CERT,SSL_R_UNKNOWN_CERTIFICATE_TYPE);
+ EVP_PKEY_free(pkey);
return(0);
}
@@ -549,6 +552,7 @@ X509 *x;
else
ok=1;
+ EVP_PKEY_free(pkey);
if (bad)
{
EVP_PKEY_free(c->pkeys[i].privatekey);