---
name: "ares_free_data"
section: "3"
platform: "linux"
package: "c-ares"
version: "1.34.9-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ares_free_data"
---

# ares\_free\_data(3)

Free data allocated by several c-ares functions

## NAME

ares\_free\_data - Free data allocated by several c-ares functions

## SYNOPSIS

```
#include <ares.h>
void ares_free_data(void *dataptr)
```

## DESCRIPTION

The **[ares\_free\_data(3)](/ares_free_data/3.md)** function frees one or more data structures allocated and returned by several c-ares functions. Specifically the data returned by the following list of functions must be deallocated using this function.

- **[ares\_get\_servers(3)](/ares_get_servers/3.md)**

  When used to free the data returned by *[ares\_get\_servers(3)](/ares_get_servers/3.md)* this will free the whole linked list of ares\_addr\_node structures returned by *[ares\_get\_servers(3)](/ares_get_servers/3.md)*.

- **[ares\_parse\_srv\_reply(3)](/ares_parse_srv_reply/3.md)**

  When used to free the data returned by *[ares\_parse\_srv\_reply(3)](/ares_parse_srv_reply/3.md)* this will free the whole linked list of ares\_srv\_reply structures returned by *[ares\_parse\_srv\_reply(3)](/ares_parse_srv_reply/3.md)*, along with any additional storage associated with those structures.

- **[ares\_parse\_mx\_reply(3)](/ares_parse_mx_reply/3.md)**

  When used to free the data returned by *[ares\_parse\_mx\_reply(3)](/ares_parse_mx_reply/3.md)* this will free the whole linked list of ares\_mx\_reply structures returned by *[ares\_parse\_mx\_reply(3)](/ares_parse_mx_reply/3.md)*, along with any additional storage associated with those structures.

- **[ares\_parse\_txt\_reply(3)](/ares_parse_txt_reply/3.md)**

  When used to free the data returned by *[ares\_parse\_txt\_reply(3)](/ares_parse_txt_reply/3.md)* this will free the whole linked list of ares\_txt\_reply structures returned by *[ares\_parse\_txt\_reply(3)](/ares_parse_txt_reply/3.md)*, along with any additional storage associated with those structures.

- **[ares\_parse\_soa\_reply(3)](/ares_parse_soa_reply/3.md)**

  When used to free the data returned by *[ares\_parse\_soa\_reply(3)](/ares_parse_soa_reply/3.md)* this will free the ares\_soa\_reply structure, along with any additional storage associated with those structure. **[ares\_parse\_uri\_reply(3)](/ares_parse_uri_reply/3.md)** When used to free the data returned by *[ares\_parse\_uri\_reply(3)](/ares_parse_uri_reply/3.md)* this will free list of ares\_uri\_reply structures, along with any additional storage associated with those structure.

## RETURN VALUE

The *[ares\_free\_data(3)](/ares_free_data/3.md)* function does not return a value.

## AVAILABILITY

This function was first introduced in c-ares version 1.7.0.

## SEE ALSO

[**ares\_get\_servers**(3)](/ares_get_servers/3.md), [**ares\_parse\_srv\_reply**(3)](/ares_parse_srv_reply/3.md), [**ares\_parse\_mx\_reply**(3)](/ares_parse_mx_reply/3.md), [**ares\_parse\_txt\_reply**(3)](/ares_parse_txt_reply/3.md), [**ares\_parse\_soa\_reply**(3)](/ares_parse_soa_reply/3.md)
