Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(498)

Unified Diff: net/socket/ssl_client_socket_nss.cc

Issue 2867026: Make X509Certificate::CreateFromHandle() copy the OSCertHandle, rather than assume ownership (Closed)
Patch Set: Deleted one comment too many Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/socket/ssl_client_socket_mac.cc ('k') | net/socket/ssl_client_socket_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_nss.cc
diff --git a/net/socket/ssl_client_socket_nss.cc b/net/socket/ssl_client_socket_nss.cc
index 44aa5796a5d96a5665f741e48fed91a870a7e50e..cf74ef1c93e1d595fc93b646364e4a7425f6132d 100644
--- a/net/socket/ssl_client_socket_nss.cc
+++ b/net/socket/ssl_client_socket_nss.cc
@@ -723,11 +723,12 @@ X509Certificate *SSLClientSocketNSS::UpdateServerCert() {
cert_handle,
X509Certificate::SOURCE_FROM_NETWORK,
intermediate_ca_certs);
+ X509Certificate::FreeOSCertHandle(cert_handle);
for (size_t i = 0; i < intermediate_ca_certs.size(); ++i)
X509Certificate::FreeOSCertHandle(intermediate_ca_certs[i]);
#else
server_cert_ = X509Certificate::CreateFromHandle(
- CERT_DupCertificate(server_cert_nss_),
+ server_cert_nss_,
X509Certificate::SOURCE_FROM_NETWORK,
X509Certificate::OSCertHandles());
#endif
@@ -1257,7 +1258,8 @@ SECStatus SSLClientSocketNSS::ClientAuthHandler(
}
scoped_refptr<X509Certificate> cert = X509Certificate::CreateFromHandle(
cert_context2, X509Certificate::SOURCE_LONE_CERT_IMPORT,
- net::X509Certificate::OSCertHandles());
+ X509Certificate::OSCertHandles());
+ X509Certificate::FreeOSCertHandle(cert_context2);
that->client_certs_.push_back(cert);
}
@@ -1342,6 +1344,7 @@ SECStatus SSLClientSocketNSS::ClientAuthHandler(
cert, X509Certificate::SOURCE_LONE_CERT_IMPORT,
net::X509Certificate::OSCertHandles());
that->client_certs_.push_back(x509_cert);
+ CERT_DestroyCertificate(cert);
SECKEY_DestroyPrivateKey(privkey);
continue;
}
« no previous file with comments | « net/socket/ssl_client_socket_mac.cc ('k') | net/socket/ssl_client_socket_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698