| 80 | } |
| 81 | |
| 82 | void |
| 83 | freeaddrinfo(struct addrinfo *ai) |
| 84 | { |
| 85 | struct addrinfo *next; |
| 86 | |
| 87 | do { |
| 88 | next = ai->ai_next; |
| 89 | if (ai->ai_canonname) |
| 90 | free(ai->ai_canonname); |
| 91 | /* no need to free(ai->ai_addr) */ |
| 92 | free(ai); |
| 93 | ai = next; |
| 94 | } while (ai); |
| 95 | } |
| 96 | |
| 97 | /* Entries EAI_ADDRFAMILY (1) and EAI_NODATA (7) are obsoleted, but left */ |
| 98 | /* for backward compatibility with userland code prior to 2553bis-02 */ |