Revert "openssl: engine: remove double-free"
This reverts commit 370ee919b3.
Issue #509 has all the details but it was confirmed that the crash was
not due to this, so the previous commit was wrong.
This commit is contained in:
@@ -558,7 +558,7 @@ int cert_stuff(struct connectdata *conn,
|
|||||||
break;
|
break;
|
||||||
case SSL_FILETYPE_ENGINE:
|
case SSL_FILETYPE_ENGINE:
|
||||||
#ifdef HAVE_OPENSSL_ENGINE_H
|
#ifdef HAVE_OPENSSL_ENGINE_H
|
||||||
{
|
{ /* XXXX still needs some work */
|
||||||
EVP_PKEY *priv_key = NULL;
|
EVP_PKEY *priv_key = NULL;
|
||||||
if(data->state.engine) {
|
if(data->state.engine) {
|
||||||
#ifdef HAVE_ENGINE_LOAD_FOUR_ARGS
|
#ifdef HAVE_ENGINE_LOAD_FOUR_ARGS
|
||||||
@@ -592,7 +592,7 @@ int cert_stuff(struct connectdata *conn,
|
|||||||
EVP_PKEY_free(priv_key);
|
EVP_PKEY_free(priv_key);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* ownership of priv_key was handed over, no need to free it here */
|
EVP_PKEY_free(priv_key); /* we don't need the handle any more... */
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
failf(data, "crypto engine not set, can't load private key");
|
failf(data, "crypto engine not set, can't load private key");
|
||||||
|
|||||||
Reference in New Issue
Block a user