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

Unified Diff: chromeos/network/client_cert_resolver.cc

Issue 145273015: Fix a leak in client_cert_resolver (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 11 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 | « no previous file | chromeos/network/client_cert_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/client_cert_resolver.cc
diff --git a/chromeos/network/client_cert_resolver.cc b/chromeos/network/client_cert_resolver.cc
index 52c6612a707de7de803f0c261bea68728183e75d..dd66e94dc21689b29d608dc12cb670ffc541608c 100644
--- a/chromeos/network/client_cert_resolver.cc
+++ b/chromeos/network/client_cert_resolver.cc
@@ -30,6 +30,7 @@
#include "chromeos/tpm_token_loader.h"
#include "components/onc/onc_constants.h"
#include "dbus/object_path.h"
+#include "net/cert/scoped_nss_types.h"
#include "net/cert/x509_certificate.h"
namespace chromeos {
@@ -147,15 +148,15 @@ void FindCertificateMatches(const net::CertificateList& certs,
!HasPrivateKey(cert)) {
continue;
}
- net::X509Certificate::OSCertHandle issuer_handle =
- CERT_FindCertIssuer(cert.os_cert_handle(), PR_Now(), certUsageAnyCA);
+ net::ScopedCERTCertificate issuer_handle(
+ CERT_FindCertIssuer(cert.os_cert_handle(), PR_Now(), certUsageAnyCA));
if (!issuer_handle) {
LOG(ERROR) << "Couldn't find an issuer.";
continue;
}
scoped_refptr<net::X509Certificate> issuer =
net::X509Certificate::CreateFromHandle(
- issuer_handle,
+ issuer_handle.get(),
net::X509Certificate::OSCertHandles() /* no intermediate certs */);
if (!issuer) {
LOG(ERROR) << "Couldn't create issuer cert.";
« no previous file with comments | « no previous file | chromeos/network/client_cert_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698