---
name: "au_free_token"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/au_free_token"
---

# au\_free\_token(3)

deallocate a token\_t created by any of the au\_to\_\*() BSM API functions

## NAME

**au\_free\_token** – deallocate a token\_t created by any of the au\_to\_\*() BSM API functions

## LIBRARY

library “libbsm”

## SYNOPSIS

**#include \<bsm/libbsm.h\>**

*void*\

**au\_free\_token**(*token\_t \*tok*);

## DESCRIPTION

The BSM API generally manages deallocation of *token\_t* objects. However, if [au\_write(3)](/au_write/3.md) is passed a bad audit descriptor, the *token\_t \** parameter will be left untouched. In that case, the caller can deallocate the *token\_t* using **au\_free\_token**() if desired.

The *tok* argument is a *token\_t \** generated by one of the **au\_to\_\***() BSM API calls. For convenience, *tok* may be NULL, in which case **au\_free\_token**() returns immediately.

## IMPLEMENTATION NOTES

This is, in fact, what audit\_write(3) does, in keeping with the existing memory management model of the BSM API.

## SEE ALSO

[au\_write(3)](/au_write/3.md), audit\_write(3), [libbsm(3)](/libbsm/3.md)

## HISTORY

The OpenBSM implementation was created by McAfee Research, the security division of McAfee Inc., under contract to Apple Computer, Inc., in 2004. It was subsequently adopted by the TrustedBSD Project as the foundation for the OpenBSM distribution.

## AUTHORS

This software was created by Robert Watson, Wayne Salamon, and Suresh Krishnaswamy for McAfee Research, the security research division of McAfee, Inc., under contract to Apple Computer, Inc.

The Basic Security Module (BSM) interface to audit records and audit event stream format were defined by Sun Microsystems.
