<!--
{
  "availability" : [
    "macOS: 10.2.0 - 10.10.0"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecKeychainItemFreeAttributesAndData(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@SecKeychainItemFreeAttributesAndData"
  },
  "title" : "SecKeychainItemFreeAttributesAndData(_:_:)"
}
-->

# SecKeychainItemFreeAttributesAndData(_:_:)

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

```
func SecKeychainItemFreeAttributesAndData(_ 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

A result code. See [Security Framework Result Codes](/documentation/Security/security-framework-result-codes).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)