Function

SecKeychainItemFreeContent(_:_:)

Releases the memory used by the keychain attribute list and the keychain data retrieved in a call to the SecKeychainItemCopyContent(_:_:_:_:_:) function.

Declaration

func SecKeychainItemFreeContent(_ attrList: UnsafeMutablePointer<SecKeychainAttributeList>?, _ data: UnsafeMutableRawPointer?) -> OSStatus

Parameters

attrList

A pointer to the attribute list to release. Pass NULL if there is no attribute list to release.

data

A pointer to the data buffer to release. Pass NULL if there is no data to release.

Return Value

Discussion

Because the SecKeychainFindInternetPassword(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:) and SecKeychainFindGenericPassword(_:_:_:_:_:_:_:_:) functions call the SecKeychainItemCopyContent(_:_:_:_:_:) function, you must call SecKeychainItemFreeContent to release the data buffers after calls to those functions as well.

Because the SecKeychainItemCopyContent function does not allocate buffers until they are needed, you should not call the SecKeychainItemFreeContent function unless data is actually returned to you.

See Also

Legacy Keychain Item Management

func SecKeychainItemFreeAttributesAndData(UnsafeMutablePointer<SecKeychainAttributeList>?, UnsafeMutableRawPointer?) -> OSStatus

Releases the memory used by the keychain attribute list and/or the keychain data retrieved in a call to SecKeychainItemCopyAttributesAndData.

func SecKeychainItemDelete(SecKeychainItem) -> OSStatus

Deletes a keychain item from the default keychain’s permanent data store.

typealias SecKeychainAttrType

The keychain attribute type.

struct SecKeychainAttribute

A structure that holds a single keychain attribute.

typealias SecKeychainAttributePtr

A pointer to a keychain attribute structure.

struct SecKeychainAttributeList

A list of keychain attributes.