kishikawakatsumi / UICKeyChainStore

UICKeyChainStore is a simple wrapper for Keychain on iOS, watchOS, tvOS and macOS. Makes using Keychain APIs as easy as NSUserDefaults.
http://kishikawakatsumi.com
MIT License
3.09k stars 382 forks source link

Fixing Analysis warning for potential memory leak #109

Closed glentregoning closed 9 years ago

glentregoning commented 9 years ago

Analysis of this code using Xcode 7 produces the following warning:

These changes release accessControl on error or use a _bridge_transfer to transfer ownership to the attributes dictionary.

/Users/glen.tregoning/Source/belieber/Pods/UICKeyChainStore/Lib/UICKeyChainStore/UICKeyChainStore.m:1173:49: warning: Potential leak of an object stored into 'accessControl'
            SecAccessControlRef accessControl = SecAccessControlCreateWithFlags(kCFAllocatorDefault, accessibilityObject, (SecAccessControlCreateFlags)_authenticationPolicy, &securityError);
glentregoning commented 9 years ago

@kishikawakatsumi any chance you could have a look at this?

kishikawakatsumi commented 9 years ago

@glentregoning Sorry for the delay. I'll look your PR tomorrow. Thanks for PR.

kishikawakatsumi commented 9 years ago

Great! Thanks for your PR!! :+1: