title: SecItemCopyMatching still leak on osx under ARC
body: <p>i found memory leak on SecItemCopyMatching. After investigate on SF i was found solution:</p>
  
  <pre><code>__block NSString *certificateName = nil;
  SecKeychainRef keychain;
  SecKeychainCopyDefault(&amp;keychain);
  NSMutableDictionary *attributeQuery = [NSMutableDictionary dictionary];
  [attributeQuery setObject: (id) kSecClassIdentity forKey:(__bridge_transfer id) kSecClass];
  [attributeQuery setObject: (id) kCFBooleanTrue forKey:(__bridge_transfer id) kSecReturnRef];
  [attributeQuery setObject: (id) kSecMatchLimitAll forKey:(__bridge_transfer id) kSecMatchLimit];
  CFTypeRef attrResult = NULL;
  OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef) attributeQuery,(CFTypeRef *) &amp;attrResult);&lt;------- here is a leak according Instruments
  
  
  if (status != errSecItemNotFound) {
      NSArray *attributeResult = (__bridge_transfer NSArray *)attrResult;
      [attributeResult enumerateObjectsUsingBlock:^(id identityFromArray, NSUInteger idx, BOOL *stop) {
          OSStatus status;
          SecCertificateRef cert = NULL;
          status = SecIdentityCopyCertificate((__bridge SecIdentityRef)identityFromArray, &amp;cert);
          if (!status)
          {
  </code></pre>
  
  <p>or another solution:</p>
  
  <pre><code>NSMutableDictionary *attributeQuery = [NSMutableDictionary dictionary];
  [attributeQuery setObject: (id) kSecClassIdentity forKey:(__bridge_transfer id) kSecClass];
  [attributeQuery setObject: (id) kCFBooleanTrue forKey:(__bridge_transfer id) kSecReturnRef];
  [attributeQuery setObject: (id) kSecMatchLimitAll forKey:(__bridge_transfer id) kSecMatchLimit];
  CFTypeRef attrResult = NULL;
  CFDictionaryRef cfquery = (__bridge_retained CFDictionaryRef)attributeQuery;
  OSStatus status = SecItemCopyMatching(cfquery,(CFTypeRef *) &amp;attrResult);&lt;------- here is a leak according Instruments
  
  
  if (status != errSecItemNotFound) {
      NSArray *attributeResult = (__bridge_transfer NSArray *)attrResult;
      [attributeResult enumerateObjectsUsingBlock:^(id identityFromArray, NSUInteger idx, BOOL *stop) {
          OSStatus status;
          SecCertificateRef cert = NULL;
          status = SecIdentityCopyCertificate((__bridge SecIdentityRef)identityFromArray, &amp;cert);
          if (!status)
          {
              char *nameBuf = NULL;
              CFStringRef nameRef = NULL;
              OSStatus statusNew = SecCertificateInferLabel(cert, &amp;nameRef);
              .....
  CFRelease(cfquery)
  </code></pre>
  
  <p>But both of them still do leak for me.</p>
  
  <p>Any another ideas</p>