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

# AuthorizationFree(_:_:)

Frees the memory associated with an authorization reference.

```
func AuthorizationFree(_ authorization: AuthorizationRef, _ flags: AuthorizationFlags) -> OSStatus
```

## Parameters

`authorization`

The authorization reference to free.

`flags`

A bit mask. In most cases, pass the constant [`kAuthorizationFlagDefaults`](/documentation/Security/AuthorizationFlags/kAuthorizationFlagDefaults). To remove all shared and non-shared authorizations, pass the constant [`destroyRights`](/documentation/Security/AuthorizationFlags/destroyRights).

## Return Value

A result code. See [Authorization Services Result Codes](/documentation/Security/authorization-services-result-codes).

## Discussion

Call this function when your application no longer needs the authorization reference you created using the function [`AuthorizationCreate(_:_:_:_:)`](/documentation/Security/AuthorizationCreate(_:_:_:_:)).

---

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)