summaryrefslogtreecommitdiffstats
path: root/net/socket/ssl_client_socket_win.cc
diff options
context:
space:
mode:
authorrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-26 18:44:05 +0000
committerrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-26 18:44:05 +0000
commit1c8857bce13d0fb7a7ee8f12c154a2392afe00a2 (patch)
tree3a4262dee2b95c95c909da3323208274190f11bd /net/socket/ssl_client_socket_win.cc
parent6f7a602151b8a9c4437f9756766782d8b0f8196f (diff)
downloadchromium_src-1c8857bce13d0fb7a7ee8f12c154a2392afe00a2.zip
chromium_src-1c8857bce13d0fb7a7ee8f12c154a2392afe00a2.tar.gz
chromium_src-1c8857bce13d0fb7a7ee8f12c154a2392afe00a2.tar.bz2
Make X509Certificate::CreateFromHandle() copy the OSCertHandle, rather than assume ownership
R=wtc BUG=47463 TEST=none Review URL: http://codereview.chromium.org/2867026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50938 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/ssl_client_socket_win.cc')
-rw-r--r--net/socket/ssl_client_socket_win.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/socket/ssl_client_socket_win.cc b/net/socket/ssl_client_socket_win.cc
index 7fd1f7c..a0da5f4 100644
--- a/net/socket/ssl_client_socket_win.cc
+++ b/net/socket/ssl_client_socket_win.cc
@@ -415,8 +415,9 @@ void SSLClientSocketWin::GetSSLCertRequestInfo(
}
scoped_refptr<X509Certificate> cert = X509Certificate::CreateFromHandle(
cert_context2, X509Certificate::SOURCE_LONE_CERT_IMPORT,
- net::X509Certificate::OSCertHandles());
+ X509Certificate::OSCertHandles());
cert_request_info->client_certs.push_back(cert);
+ CertFreeCertificateContext(cert_context2);
}
FreeContextBuffer(issuer_list.aIssuers);
@@ -1307,15 +1308,15 @@ int SSLClientSocketWin::DidCompleteHandshake() {
server_cert_handle)) {
// We already verified the server certificate. Either it is good or the
// user has accepted the certificate error.
- CertFreeCertificateContext(server_cert_handle);
DidCompleteRenegotiation();
} else {
server_cert_ = X509Certificate::CreateFromHandle(
server_cert_handle, X509Certificate::SOURCE_FROM_NETWORK,
- net::X509Certificate::OSCertHandles());
+ X509Certificate::OSCertHandles());
next_state_ = STATE_VERIFY_CERT;
}
+ CertFreeCertificateContext(server_cert_handle);
return OK;
}