From: Richard Levitte Date: Tue, 12 Dec 2000 08:08:53 +0000 (+0000) Subject: SSL_new() may potentially add a certfificate. Therefore, wen X-Git-Tag: OpenSSL_0_9_6a-beta1~81^2~157 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=34d69d3b23741f89de9bda49d35a8e72fc2f3405;p=openssl 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 --- 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;