aboutsummaryrefslogtreecommitdiffstats
path: root/ssl/ssl_lib.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2000-12-12 08:08:53 +0000
committerRichard Levitte <levitte@openssl.org>2000-12-12 08:08:53 +0000
commit34d69d3b23741f89de9bda49d35a8e72fc2f3405 (patch)
treefae65b08160eff35c2dc339128c3f1c06d647928 /ssl/ssl_lib.c
parentdaea0ff8a960237e0f9a71301721824c25ad3b25 (diff)
downloadopenssl-34d69d3b23741f89de9bda49d35a8e72fc2f3405.tar.gz
SSL_new() may potentially add a certfificate. Therefore, wen
duplicating the certificate that is in the original SSL, remove the one that SSL_new() provided, if any. Spotted by: Mike Zeoli <zeoli@roguewave.com>
Diffstat (limited to 'ssl/ssl_lib.c')
-rw-r--r--ssl/ssl_lib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index c757ea874e..24f314e5b9 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -1718,6 +1718,10 @@ SSL *SSL_dup(SSL *s)
if (s->cert != NULL)
{
+ if (ret->cert != NULL)
+ {
+ ssl_cert_free(ret->cert);
+ }
ret->cert = ssl_cert_dup(s->cert);
if (ret->cert == NULL)
goto err;