Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/net allow freeaddrinfo(NULL). nothing is talked in...



details:   https://anonhg.NetBSD.org/src/rev/87262f01d666
branches:  trunk
changeset: 481371:87262f01d666
user:      itojun <itojun%NetBSD.org@localhost>
date:      Thu Jan 27 08:25:51 2000 +0000

description:
allow freeaddrinfo(NULL).  nothing is talked in RFC2553 (maybe in X/Open?).
however, since NRL freeaddrinfo permits it, we need to.

diffstat:

 lib/libc/net/getaddrinfo.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (26 lines):

diff -r 1a769daadbcb -r 87262f01d666 lib/libc/net/getaddrinfo.c
--- a/lib/libc/net/getaddrinfo.c        Thu Jan 27 07:50:02 2000 +0000
+++ b/lib/libc/net/getaddrinfo.c        Thu Jan 27 08:25:51 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getaddrinfo.c,v 1.24 2000/01/26 06:51:29 itojun Exp $  */
+/*     $NetBSD: getaddrinfo.c,v 1.25 2000/01/27 08:25:51 itojun Exp $  */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -235,13 +235,14 @@
 {
        struct addrinfo *next;
 
-       do {
+       while (ai) {
                next = ai->ai_next;
                if (ai->ai_canonname)
                        free(ai->ai_canonname);
                /* no need to free(ai->ai_addr) */
                free(ai);
-       } while ((ai = next) != NULL);
+               ai = next;
+       }
 }
 
 static int



Home | Main Index | Thread Index | Old Index