---
title: "es_free_message(_:)"
framework: endpointsecurity
role: symbol
role_heading: Function
path: "endpointsecurity/es_free_message(_:)"
---

# es_free_message(_:)

Frees the memory allocated for the given message.

## Declaration

```swift
func es_free_message(_ msg: UnsafeMutablePointer<es_message_t>)
```

## Parameters

- `msg`: The message to free.

## Discussion

Discussion Only free messages you explicitly copied with es_copy_message(_:). warning: Freeing a message from inside a handler block will cause your app to crash.

## See Also

### Deprecated Functions

- [es_copy_message(_:)](endpointsecurity/es_copy_message(_:).md)
- [es_message_size(_:)](endpointsecurity/es_message_size(_:).md)
