[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Base Operating System and Extensions Technical Reference, Volume 1

freeaddrinfo Subroutine

Purpose

To free memory allocated by getaddrinfo. This includes the addrinfo structures, the socket address structures, and canonical host name strings pointed to by the addrinfo structures.

Library

Library (libc.a)

Syntax

#include <sys/socket.h>
#include <netdb.h>
void freeaddrinfo (ai)
struct addrinfo *ai;

Description

This function frees any dynamic storage pointed to by elements of ai, as well as the space for ai itself. Also, it will descend the linked list, repeating this process for all nodes in the list until a NULL ai_next pointer is encountered.

Related Information

The getaddrinfo subroutine, gai_strerror, and getnameinfo subroutine.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]