1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

Evan Jordan's fix for a memory leak. Bug report 650989.

This commit is contained in:
Daniel Stenberg 2002-12-13 14:08:49 +00:00
parent 9ae920c1b6
commit 3aea0d3d68

View File

@ -325,10 +325,15 @@ int cert_stuff(struct connectdata *conn,
ssl=SSL_new(conn->ssl.ctx); ssl=SSL_new(conn->ssl.ctx);
x509=SSL_get_certificate(ssl); x509=SSL_get_certificate(ssl);
if (x509 != NULL) /* This version was provided by Evan Jordan and is supposed to not
EVP_PKEY_copy_parameters(X509_get_pubkey(x509), leak memory as the previous version: */
SSL_get_privatekey(ssl)); if (x509 != NULL) {
EVP_PKEY *pktmp = X509_get_pubkey(x509);
EVP_PKEY_copy_parameters(pktmp,SSL_get_privatekey(ssl));
EVP_PKEY_free(pktmp);
}
SSL_free(ssl); SSL_free(ssl);
/* If we are using DSA, we can copy the parameters from /* If we are using DSA, we can copy the parameters from