diff --git a/Lib/UICKeyChainStore/UICKeyChainStore.m b/Lib/UICKeyChainStore/UICKeyChainStore.m index 003ccb0..9b3043f 100644 --- a/Lib/UICKeyChainStore/UICKeyChainStore.m +++ b/Lib/UICKeyChainStore/UICKeyChainStore.m @@ -784,7 +784,9 @@ + (NSArray *)allKeysWithItemClass:(UICKeyChainStoreItemClass)itemClass query[(__bridge __strong id)kSecReturnAttributes] = (__bridge id)kCFBooleanTrue; CFArrayRef result = nil; - OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query,(CFTypeRef *)&result); + CFDictionaryRef cfquery = (CFDictionaryRef)CFBridgingRetain(query); + OSStatus status = SecItemCopyMatching(cfquery,(CFTypeRef *)&result); + CFRelease(cfquery); if (status == errSecSuccess) { NSArray *items = [self prettify:itemClassObject items:(__bridge NSArray *)result]; @@ -822,7 +824,9 @@ + (NSArray *)allItemsWithItemClass:(UICKeyChainStoreItemClass)itemClass #endif CFArrayRef result = nil; - OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query,(CFTypeRef *)&result); + CFDictionaryRef cfquery = (CFDictionaryRef)CFBridgingRetain(query); + OSStatus status = SecItemCopyMatching(cfquery,(CFTypeRef *)&result); + CFRelease(cfquery); if (status == errSecSuccess) { return [self prettify:itemClassObject items:(__bridge NSArray *)result];