SSL_new() may potentially add a certfificate. Therefore, wen
authorRichard Levitte <levitte@openssl.org>
Tue, 12 Dec 2000 08:08:53 +0000 (08:08 +0000)
committerRichard Levitte <levitte@openssl.org>
Tue, 12 Dec 2000 08:08:53 +0000 (08:08 +0000)
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>

ssl/ssl_lib.c

index c757ea8..24f314e 100644 (file)
@@ -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;