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

Unified Diff: net/socket/ssl_client_socket_nss.cc

Issue 8308009: Fix a potential CFRelease(NULL). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oh man Created 9 years, 2 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 | no next file » | 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 bd7117d77c1700ebf01002b1fe4f16ac6d44722d..127394098085bf8c9cb78ed0ca598ac3234055c9 100644
--- a/net/socket/ssl_client_socket_nss.cc
+++ b/net/socket/ssl_client_socket_nss.cc
@@ -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)));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698