Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

freeaddrinfo() - release memory for addrinfo structure

&pagelevel(4)&pagelevel

#include <netdb.h>

void freeaddrinfo(struct addrinfo *ai);

Description

The freeaddrinfo() function releases the memory area of a concatenated list of struct addrinfo objects which was requested beforehand with the getaddrinfo() function.

The ai parameter is a pointer to the first addrinfo object in a list of several concatenated addrinfo objects.

The addrinfo structure is declared as follows:

struct addrinfo {
   int ai_flags;               /* AI_PASSIVE, AI_CANONNAME */
   int ai_family;              /* PF_INET, PF_INET6 */
   int ai_socktype;            /* SOCK_STREAM, SOCK_DGRAM */
   int ai_protocol;            /* 0 or IPPROTO_xxx for IP */
   size_t ai_addrlen;          /* length of ai_addr */
   char *ai_canonname;         /* canon name */
   struct sockaddr *ai_addr;   /* socket address structure */
   struct addrinfo *ai_next;   /* next structure in list */
};