summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc/net/freeaddrinfo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/net/freeaddrinfo.c b/lib/libc/net/freeaddrinfo.c
index 40534f44224..30fbecb805a 100644
--- a/lib/libc/net/freeaddrinfo.c
+++ b/lib/libc/net/freeaddrinfo.c
@@ -39,11 +39,11 @@ freeaddrinfo(ai)
{
struct addrinfo *p;
- while (ai) {
+ do {
p = ai;
ai = ai->ai_next;
if (p->ai_canonname)
free(p->ai_canonname);
free((void *)p);
- }
+ } while (ai);
}