---
title: "AuthorizationFree(_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/authorizationfree(_:_:)"
---

# AuthorizationFree(_:_:)

Frees the memory associated with an authorization reference.

## Declaration

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

## Parameters

- `authorization`: The authorization reference to free.
- `flags`: A bit mask. In most cases, pass the constant doc://com.apple.security/documentation/Security/AuthorizationFlags/kAuthorizationFlagDefaults. To remove all shared and non-shared authorizations, pass the constant doc://com.apple.security/documentation/Security/AuthorizationFlags/destroyRights.

## Return Value

Return Value A result code. See Authorization Services Result Codes.

## Discussion

Discussion Call this function when your application no longer needs the authorization reference you created using the function AuthorizationCreate(_:_:_:_:).
