11.8 freeaddrinfo Function
All the storage returned by getaddrinfo, the addrinfo structures, the ai_addr structures, and the ai_canonname string are obtained dynamically (e.g., from malloc). This storage is returned by calling freeaddrinfo.
#include <netdb.h> |
void freeaddrinfo (struct addrinfo *ai); |
Making a copy of just the addrinfo structure and not the structures that it in turn points to is called a shallow copy . Copying the addrinfo structure and all the structures that it points to is called a deep copy .