ARES\_FREE\_HOSTENT(3) Library Functions Manual ARES\_FREE\_HOSTENT(3)

# [NAME](#NAME)

ares\_free\_hostent - Free host structure allocated by ares functions

# [SYNOPSIS](#SYNOPSIS)

```
#include <ares.h>
void ares_free_hostent(struct hostent *host)
```

# [DESCRIPTION](#DESCRIPTION)

The *ares\_free\_hostent* function frees a **struct hostent** allocated by one of the functions [*ares\_parse\_a\_reply(3)*](/man/os/c-ares/ares_parse_a_reply.3), [*ares\_parse\_aaaa\_reply(3)*](/man/os/c-ares/ares_parse_aaaa_reply.3), or [*ares\_parse\_ptr\_reply(3)*](/man/os/c-ares/ares_parse_ptr_reply.3).

# [NOTES](#NOTES)

It is not necessary (and is not correct) to free the host structure passed to the callback functions for [*ares\_gethostbyname(3)*](/man/os/c-ares/ares_gethostbyname.3) or [*ares\_gethostbyaddr(3)*](/man/os/c-ares/ares_gethostbyaddr.3). c-ares will automatically free such host structures when the callback returns.

# [SEE ALSO](#SEE_ALSO)

[**ares\_parse\_a\_reply**(3)](/man/os/c-ares/ares_parse_a_reply.3), [**ares\_parse\_aaaa\_reply**(3)](/man/os/c-ares/ares_parse_aaaa_reply.3), [**ares\_parse\_ptr\_reply**(3)](/man/os/c-ares/ares_parse_ptr_reply.3), [**ares\_parse\_ns\_reply**(3)](/man/os/c-ares/ares_parse_ns_reply.3)

23 July 1998

---

Document: ares_free_hostent(3) from c-ares 1.34.9-r0 (Chainguard OS)
Source: https://github.com/c-ares/c-ares
