Skip to content
Snippets Groups Projects
Commit 3aea0d3d authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

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

parent 9ae920c1
No related branches found
No related tags found
No related merge requests found
......@@ -325,10 +325,15 @@ int cert_stuff(struct connectdata *conn,
ssl=SSL_new(conn->ssl.ctx);
x509=SSL_get_certificate(ssl);
if (x509 != NULL)
EVP_PKEY_copy_parameters(X509_get_pubkey(x509),
SSL_get_privatekey(ssl));
/* This version was provided by Evan Jordan and is supposed to not
leak memory as the previous version: */
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);
/* If we are using DSA, we can copy the parameters from
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment