Commit 6c293a7b authored by thakis@chromium.org's avatar thakis@chromium.org

Fix a potential CFRelease(NULL).

It would happen if CreateClientCertificateChain() returns NULL.
Found by the clang static analyzer. Probably doesn't happen in
practice.

BUG=none
TEST=none


Review URL: http://codereview.chromium.org/8308009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107041 0039d316-1c4b-4281-b951-d872f2087c98
parent fbf59d6e
......@@ -2383,8 +2383,11 @@ SECStatus SSLClientSocketNSS::PlatformClientAuthHandler(
}
}
if (os_error == noErr) {
int cert_count = CFArrayGetCount(chain);
CFRelease(chain);
int cert_count = 0;
if (chain) {
cert_count = CFArrayGetCount(chain);
CFRelease(chain);
}
that->net_log_.AddEvent(NetLog::TYPE_SSL_CLIENT_CERT_PROVIDED,
make_scoped_refptr(new NetLogIntegerParameter("cert_count",
cert_count)));
......
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