Skip to content

Commit

Permalink
net_ssl: free certs after setting them up
Browse files Browse the repository at this point in the history
  • Loading branch information
moneromooo-monero committed May 10, 2019
1 parent c0bc6d9 commit 9a7a453
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contrib/epee/src/net_ssl.cpp
Expand Up @@ -352,7 +352,7 @@ boost::asio::ssl::context ssl_options_t::create_context() const
MERROR("Failed to use generated EC private key for " << NID_secp256k1);
else
ok = true;
// don't free the cert, the CTX owns it now
X509_free(cert);
EVP_PKEY_free(pkey);
#endif

Expand All @@ -362,7 +362,7 @@ boost::asio::ssl::context ssl_options_t::create_context() const
MERROR("Failed to use generated RSA private key for RSA");
else
ok = true;
// don't free the cert, the CTX owns it now
X509_free(cert);
EVP_PKEY_free(pkey);

CHECK_AND_ASSERT_THROW_MES(ok, "Failed to use any generated certificate");
Expand Down

0 comments on commit 9a7a453

Please sign in to comment.