summaryrefslogtreecommitdiffstats
path: root/apps
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 /apps
parent1750ebcba914d87602007447433529f871d088f5 (diff)
Fix various memory leaks in SSL, apps and DSA
Diffstat (limited to 'apps')
-rw-r--r--apps/s_cb.c10
-rw-r--r--apps/s_client.c8
-rw-r--r--apps/sc.c6
3 files changed, 18 insertions, 6 deletions
diff --git a/apps/s_cb.c b/apps/s_cb.c
index 1a7b06e1ee..ba0b548ea1 100644
--- a/apps/s_cb.c
+++ b/apps/s_cb.c
@@ -156,9 +156,13 @@ char *key_file;
ssl=SSL_new(ctx);
x509=SSL_get_certificate(ssl);
- if (x509 != NULL)
- EVP_PKEY_copy_parameters(X509_get_pubkey(x509),
- SSL_get_privatekey(ssl));
+ if (x509 != NULL) {
+ EVP_PKEY *pktmp;
+ pktmp = X509_get_pubkey(x509);
+ EVP_PKEY_copy_parameters(pktmp,
+ SSL_get_privatekey(ssl));
+ EVP_PKEY_free(pktmp);
+ }
SSL_free(ssl);
*/
diff --git a/apps/s_client.c b/apps/s_client.c
index 2830785c95..a75e8ae311 100644
--- a/apps/s_client.c
+++ b/apps/s_client.c
@@ -743,9 +743,13 @@ int full;
BIO_printf(bio,"%s, Cipher is %s\n",
SSL_CIPHER_get_version(c),
SSL_CIPHER_get_name(c));
- if (peer != NULL)
+ if (peer != NULL) {
+ EVP_PKEY *pktmp;
+ pktmp = X509_get_pubkey(peer);
BIO_printf(bio,"Server public key is %d bit\n",
- EVP_PKEY_bits(X509_get_pubkey(peer)));
+ EVP_PKEY_bits(pktmp));
+ EVP_PKEY_free(pktmp);
+ }
SSL_SESSION_print(bio,SSL_get_session(s));
BIO_printf(bio,"---\n");
if (peer != NULL)
diff --git a/apps/sc.c b/apps/sc.c
index f6015e8329..fccd805921 100644
--- a/apps/sc.c
+++ b/apps/sc.c
@@ -770,8 +770,12 @@ int full;
SSL_CIPHER_get_version(c),
SSL_CIPHER_get_name(c));
if (peer != NULL)
+ {
+ EVP_PKEY *pktmp;
BIO_printf(bio,"Server public key is %d bit\n",
- EVP_PKEY_bits(X509_get_pubkey(peer)));
+ EVP_PKEY_bits(pktmp));
+ EVP_PKEY_free(pktmp);
+ }
SSL_SESSION_print(bio,SSL_get_session(s));
BIO_printf(bio,"---\n");
if (peer != NULL)