ARES_FREE_DATA(3)
π ARES_FREE_DATA(3) π
okay bestie, gather round, we're doing memory management and we're doing it cutely. this is a page from the Library Functions Manual, and it's all about ares_free_data β the lil cleanup queen of the c-ares world. she doesn't build anything, she doesn't fetch anything, she just frees stuff. and honestly? iconic behaviour.
β¨ NAME β¨
ares_free_data β free data allocated by several c-ares functions π§Ήπ
πΈ SYNOPSIS πΈ
#include <ares.h>
void ares_free_data(void *dataptr)
π¦ DESCRIPTION π¦
so, ares_free_data(3) frees one or more data structures that were allocated and handed back to you by several c-ares functions. no cap, if you got a pointer from one of the functions on this list, you must deallocate it using this function. not free(), not vibes, not hoping the OS forgives you. this one. periodt.
ares_get_servers(3)β when you use it to free the data returned byares_get_servers(3), this will free the whole linked list ofares_addr_nodestructures thatares_get_servers(3)returned. the entire chain, gone, slay.ares_parse_srv_reply(3)β when you use it to free the data returned byares_parse_srv_reply(3), this will free the whole linked list ofares_srv_replystructures thatares_parse_srv_reply(3)returned, along with any additional storage associated with those structures. yes bestie, the extra storage too, she's thorough like that.ares_parse_mx_reply(3)β when you use it to free the data returned byares_parse_mx_reply(3), this will free the whole linked list ofares_mx_replystructures thatares_parse_mx_reply(3)returned, along with any additional storage associated with those structures. mwah, spotless.ares_parse_txt_reply(3)β when you use it to free the data returned byares_parse_txt_reply(3), this will free the whole linked list ofares_txt_replystructures thatares_parse_txt_reply(3)returned, along with any additional storage associated with those structures. every last crumb πares_parse_soa_reply(3)β when you use it to free the data returned byares_parse_soa_reply(3), this will free theares_soa_replystructure, along with any additional storage associated with that structure.ares_parse_uri_reply(3)β when you use it to free the data returned byares_parse_uri_reply(3), this will free the list ofares_uri_replystructures, along with any additional storage associated with those structures.
ngl, that SOA and URI entry were cuddled up together in the original text like two besties sharing a blanket. i gave them their own bullets so your eyes don't have to work that hard. same facts, better vibes π«Ά
β RETURN VALUE β
ares_free_data(3) does not return a value. that's it. nothing comes back. she takes and she takes and she leaves silently like a main character exiting a party. no return value, no drama. π
π AVAILABILITY π
this function was first introduced in c-ares version 1.7.0. so if you're on something older than that, bestieβ¦ the function simply isn't there. manifesting an upgrade for you β¨
π SEE ALSO π
ares_get_servers(3), ares_parse_srv_reply(3), ares_parse_mx_reply(3), ares_parse_txt_reply(3), ares_parse_soa_reply(3)
and that's the whole page, bestie!! π this version of the c-ares docs is dated 5 March 2010 β yeah, she's an elder but she still ate β and it comes to you courtesy of the c-ares crew. go forth, free your linked lists, and remember: every pointer you allocate deserves its goodbye kiss πβ¨
π¦ where this page comes from
- alpine 3.22: c-ares-doc 1.34.9-r0 Β· MIT
- alpine 3.23: c-ares-doc 1.34.9-r0 Β· MIT
- alpine 3.24: c-ares-doc 1.34.9-r0 Β· MIT
- arch rolling: c-ares 1.34.9-1 Β· MIT
- centos-stream 10: c-ares-devel 1.34.9-1.el10 Β· MIT
- debian trixie: libc-ares-dev 1.34.5-1+deb13u1 Β· MIT
- fedora 43: c-ares-devel 1.34.5-2.fc43 Β· MIT
- fedora 43: c-ares-devel 1.34.5-2.fc43 Β· MIT
- fedora 43: c-ares-devel 1.34.8-1.fc43 Β· MIT
- fedora 43: c-ares-devel 1.34.8-1.fc43 Β· MIT
- fedora 44: c-ares-devel 1.34.6-3.fc44 Β· MIT
- fedora 44: c-ares-devel 1.34.6-3.fc44 Β· MIT
- fedora 44: c-ares-devel 1.34.8-1.fc44 Β· MIT
- fedora 44: c-ares-devel 1.34.8-1.fc44 Β· MIT
- nixos 26.05: c-ares 1.34.9
- nixpkgs unstable: c-ares 1.34.8
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 Β· MIT
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 Β· MIT
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 Β· MIT
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 Β· MIT
- ubuntu questing: libc-ares-dev 1.34.5-1
- ubuntu questing: libc-ares-dev 1.34.5-1ubuntu0.1
- ubuntu resolute: libc-ares-dev 1.34.6-1 Β· MIT
- ubuntu resolute: libc-ares-dev 1.34.6-1ubuntu0.1
- ubuntu resolute: libc-ares-dev 1.34.6-1ubuntu0.2 Β· MIT
- ubuntu stonking: libc-ares-dev 1.34.8-1 Β· MIT
- π the page's license: MIT
- Copyright 1998 by the Massachusetts Institute of Technology
- Copyright (C) 2004-2010 by Daniel Stenberg
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms