Index: net/ssl/openssl_client_key_store.cc |
diff --git a/net/ssl/openssl_client_key_store.cc b/net/ssl/openssl_client_key_store.cc |
index 9b1b8767cf776d176e986ad623a3d0d8acc5f10d..fb1b172a71ad67d231856717ac7f932e2830cc6f 100644 |
--- a/net/ssl/openssl_client_key_store.cc |
+++ b/net/ssl/openssl_client_key_store.cc |
@@ -39,16 +39,18 @@ OpenSSLClientKeyStore::~OpenSSLClientKeyStore() { |
} |
OpenSSLClientKeyStore::KeyPair::KeyPair(EVP_PKEY* pub_key, EVP_PKEY* priv_key) |
- : public_key(EVP_PKEY_up_ref(pub_key)), |
- private_key(EVP_PKEY_up_ref(priv_key)) { |
+ : public_key(pub_key), private_key(priv_key) { |
+ EVP_PKEY_up_ref(pub_key); |
+ EVP_PKEY_up_ref(priv_key); |
} |
OpenSSLClientKeyStore::KeyPair::~KeyPair() { |
} |
OpenSSLClientKeyStore::KeyPair::KeyPair(const KeyPair& other) |
- : public_key(EVP_PKEY_up_ref(other.public_key.get())), |
- private_key(EVP_PKEY_up_ref(other.private_key.get())) { |
+ : public_key(other.public_key.get()), private_key(other.private_key.get()) { |
+ EVP_PKEY_up_ref(public_key.get()); |
+ EVP_PKEY_up_ref(private_key.get()); |
} |
void OpenSSLClientKeyStore::KeyPair::operator=(KeyPair other) { |
@@ -109,8 +111,8 @@ crypto::ScopedEVP_PKEY OpenSSLClientKeyStore::FetchClientCertPrivateKey( |
if (index < 0) |
return crypto::ScopedEVP_PKEY(); |
- return crypto::ScopedEVP_PKEY( |
- EVP_PKEY_up_ref(pairs_[index].private_key.get())); |
+ EVP_PKEY_up_ref(pairs_[index].private_key.get()); |
+ return crypto::ScopedEVP_PKEY(pairs_[index].private_key.get()); |
} |
void OpenSSLClientKeyStore::Flush() { |