Commit a52857b5 authored by rsleevi's avatar rsleevi Committed by Commit bot

Fix a memory leak in net::CertVerifyProcMac::VerifyInternal

BUG=455533

Review URL: https://codereview.chromium.org/886933008

Cr-Commit-Position: refs/heads/master@{#314931}
parent 81b17e06
...@@ -490,8 +490,8 @@ int CertVerifyProcMac::VerifyInternal( ...@@ -490,8 +490,8 @@ int CertVerifyProcMac::VerifyInternal(
// array of certificates, the first of which is the certificate we're // array of certificates, the first of which is the certificate we're
// verifying, and the subsequent (optional) certificates are used for // verifying, and the subsequent (optional) certificates are used for
// chain building. // chain building.
ScopedCFTypeRef<CFMutableArrayRef> cert_array(CFArrayCreateMutableCopy( ScopedCFTypeRef<CFMutableArrayRef> cert_array(
kCFAllocatorDefault, 0, cert->CreateOSCertChainForCert())); cert->CreateOSCertChainForCert());
// Serialize all calls that may use the Keychain, to work around various // Serialize all calls that may use the Keychain, to work around various
// issues in OS X 10.6+ with multi-threaded access to Security.framework. // issues in OS X 10.6+ with multi-threaded access to Security.framework.
......
...@@ -251,12 +251,12 @@ class NET_EXPORT X509Certificate ...@@ -251,12 +251,12 @@ class NET_EXPORT X509Certificate
// Does this certificate's usage allow SSL client authentication? // Does this certificate's usage allow SSL client authentication?
bool SupportsSSLClientAuth() const; bool SupportsSSLClientAuth() const;
// Returns a new CFArrayRef containing this certificate and its intermediate // Returns a new CFMutableArrayRef containing this certificate and its
// certificates in the form expected by Security.framework and Keychain // intermediate certificates in the form expected by Security.framework
// Services, or NULL on failure. // and Keychain Services, or NULL on failure.
// The first item in the array will be this certificate, followed by its // The first item in the array will be this certificate, followed by its
// intermediates, if any. // intermediates, if any.
CFArrayRef CreateOSCertChainForCert() const; CFMutableArrayRef CreateOSCertChainForCert() const;
#endif #endif
// Do any of the given issuer names appear in this cert's chain of trust? // Do any of the given issuer names appear in this cert's chain of trust?
......
...@@ -449,7 +449,7 @@ bool X509Certificate::SupportsSSLClientAuth() const { ...@@ -449,7 +449,7 @@ bool X509Certificate::SupportsSSLClientAuth() const {
return true; return true;
} }
CFArrayRef X509Certificate::CreateOSCertChainForCert() const { CFMutableArrayRef X509Certificate::CreateOSCertChainForCert() const {
CFMutableArrayRef cert_list = CFMutableArrayRef cert_list =
CFArrayCreateMutable(kCFAllocatorDefault, 0, CFArrayCreateMutable(kCFAllocatorDefault, 0,
&kCFTypeArrayCallBacks); &kCFTypeArrayCallBacks);
......
...@@ -259,13 +259,3 @@ ...@@ -259,13 +259,3 @@
fun:_ZN4base3mac30PathForFrameworkBundleResourceEPK10__CFString fun:_ZN4base3mac30PathForFrameworkBundleResourceEPK10__CFString
fun:_ZN3gin13IsolateHolder14LoadV8SnapshotEv fun:_ZN3gin13IsolateHolder14LoadV8SnapshotEv
} }
{
bug_455533
Memcheck:Leak
fun:malloc_zone_malloc
fun:_CFRuntimeCreateInstance
fun:__CFArrayInit
fun:_ZNK3net15X509Certificate24CreateOSCertChainForCertEv
fun:_ZN3net17CertVerifyProcMac14VerifyInternalEPNS_15X509CertificateERKSsiPNS_6CRLSetERKSt6vectorI13scoped_refptrIS1_ESaIS9_EEPNS_16CertVerifyResultE
fun:_ZN3net14CertVerifyProc6VerifyEPNS_15X509CertificateERKSsiPNS_6CRLSetERKSt6vectorI13scoped_refptrIS1_ESaIS9_EEPNS_16CertVerifyResultE
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment