---
title: "SecKeychainItemFreeContent(_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/seckeychainitemfreecontent(_:_:)"
---

# SecKeychainItemFreeContent(_:_:)

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

## Declaration

```swift
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

Return Value A result code. See Security Framework Result Codes.

## Discussion

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.
