From: Chris Araman Date: Fri, 23 Dec 2016 02:50:31 +0000 (-0800) Subject: darwinssl: fix CFArrayRef leak X-Git-Tag: curl-7_53_0~137 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e53f0736c403aa973e6937ba19d83f07922ac9cb;p=thirdparty%2Fcurl.git darwinssl: fix CFArrayRef leak Reviewed-by: Nick Zitzmann Closes #1173 --- diff --git a/lib/vtls/darwinssl.c b/lib/vtls/darwinssl.c index 2146b562df..66d8727085 100644 --- a/lib/vtls/darwinssl.c +++ b/lib/vtls/darwinssl.c @@ -885,12 +885,13 @@ static OSStatus CopyIdentityWithLabel(char *label, SecIdentityRef *out_cert_and_key) { OSStatus status = errSecItemNotFound; + +#if CURL_BUILD_MAC_10_7 || CURL_BUILD_IOS CFArrayRef keys_list; CFIndex keys_list_count; CFIndex i; CFStringRef common_name; -#if CURL_BUILD_MAC_10_7 || CURL_BUILD_IOS /* SecItemCopyMatching() was introduced in iOS and Snow Leopard. kSecClassIdentity was introduced in Lion. If both exist, let's use them to find the certificate. */ @@ -929,32 +930,35 @@ static OSStatus CopyIdentityWithLabel(char *label, if(status == noErr) { keys_list_count = CFArrayGetCount(keys_list); *out_cert_and_key = NULL; + status = 1; for(i=0; i