diff options
| author | 2000-01-28 17:47:26 +0000 | |
|---|---|---|
| committer | 2000-01-28 17:47:26 +0000 | |
| commit | 7f2fa8c6e1891b9db402e16ad8552b2ff833c3fd (patch) | |
| tree | c523d4265958cae6883504495dd247e14f6e502c /lib/libc | |
| parent | Remove perly.y so Configure doesn't think things are missing. (diff) | |
| download | wireguard-openbsd-7f2fa8c6e1891b9db402e16ad8552b2ff833c3fd.tar.xz wireguard-openbsd-7f2fa8c6e1891b9db402e16ad8552b2ff833c3fd.zip | |
don't permit freeaddrinfo(NULL). now the behavior is consistent
across {free,net,open}bsd.
both rfc2553 and X/Open spec are silent about the behavior,
and there's no strong consensus either. i think library should NOT be
forgiving in this case, to promote development of more robust 3rd-party
codebase (code works on "freeaddrinfo(NULL) = SEGV" will work on
"freeaddrinfo(NULL) is okay" environment, but not the other way around).
only issue i have now is NRL freeaddrinfo() compatibility, which permits
freeaddrinfo(NULL).
Diffstat (limited to 'lib/libc')
| -rw-r--r-- | lib/libc/net/freeaddrinfo.c | 4 |
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); } |
