Fix Bleichenbacher PKCS #1 1.5 countermeasure.
[oweals/openssl.git] / ssl / ssl_lib.c
index 0efbf20a1bd5baacac8c7aa5b6a0d67dc95e2a55..1fe85b6cb7560ac209381f11641bb55b9ac73ecf 100644 (file)
@@ -1685,6 +1685,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;