src/crypto/x509/root_cgo_darwin.go | 8 ++++---- diff --git a/src/crypto/x509/root_cgo_darwin.go b/src/crypto/x509/root_cgo_darwin.go index e6332072d62a50d89398bd4d3677fb9f02efc4aa..1c20f26acb0c51efd35bfee8b28355adf5e844b0 100644 --- a/src/crypto/x509/root_cgo_darwin.go +++ b/src/crypto/x509/root_cgo_darwin.go @@ -16,7 +16,7 @@ #include #include -static bool isSSLPolicy(SecPolicyRef policyRef) { +static Boolean isSSLPolicy(SecPolicyRef policyRef) { if (!policyRef) { return false; } @@ -24,13 +24,13 @@ CFDictionaryRef properties = SecPolicyCopyProperties(policyRef); if (properties == NULL) { return false; } + Boolean isSSL = false; CFTypeRef value = NULL; if (CFDictionaryGetValueIfPresent(properties, kSecPolicyOid, (const void **)&value)) { - CFRelease(properties); - return CFEqual(value, kSecPolicyAppleSSL); + isSSL = CFEqual(value, kSecPolicyAppleSSL); } CFRelease(properties); - return false; + return isSSL; } // sslTrustSettingsResult obtains the final kSecTrustSettingsResult value