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

Unified Diff: chromeos/network/client_cert_util.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 | « chromeos/network/client_cert_resolver.cc ('k') | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/client_cert_util.cc
diff --git a/chromeos/network/client_cert_util.cc b/chromeos/network/client_cert_util.cc
index a7ece778e3d7515bde2390de43681975b85e3730..c62c9ab17aace9c6b295ed85c423f7f3e2eaa4a6 100644
--- a/chromeos/network/client_cert_util.cc
+++ b/chromeos/network/client_cert_util.cc
@@ -16,6 +16,7 @@
#include "net/base/net_errors.h"
#include "net/cert/cert_database.h"
#include "net/cert/nss_cert_database.h"
+#include "net/cert/scoped_nss_types.h"
#include "net/cert/x509_cert_types.h"
#include "net/cert/x509_certificate.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
@@ -71,14 +72,15 @@ class IssuerCaFilter {
// Find the certificate issuer for each certificate.
// TODO(gspencer): this functionality should be available from
// X509Certificate or NSSCertDatabase.
- CERTCertificate* issuer_cert = CERT_FindCertIssuer(
- cert.get()->os_cert_handle(), PR_Now(), certUsageAnyCA);
+ net::ScopedCERTCertificate issuer_cert(CERT_FindCertIssuer(
+ cert.get()->os_cert_handle(), PR_Now(), certUsageAnyCA));
if (!issuer_cert)
return true;
std::string pem_encoded;
- if (!net::X509Certificate::GetPEMEncoded(issuer_cert, &pem_encoded)) {
+ if (!net::X509Certificate::GetPEMEncoded(issuer_cert.get(),
+ &pem_encoded)) {
LOG(ERROR) << "Couldn't PEM-encode certificate.";
return true;
}
« no previous file with comments | « chromeos/network/client_cert_resolver.cc ('k') | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698