]> git.sur5r.net Git - openldap/commitdiff
Rework getaddrinfo() stuff for ai_addr == NULL
authorKurt Zeilenga <kurt@openldap.org>
Sat, 29 Sep 2001 06:33:54 +0000 (06:33 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sat, 29 Sep 2001 06:33:54 +0000 (06:33 +0000)
servers/slapd/daemon.c

index 461e949c1857e43deb04c42ea0d33d645d2c1065..e24360c56c285bac3ce85732145c65710262b9f0 100644 (file)
@@ -398,7 +398,12 @@ static int slap_get_listener_addresses(
                sai = res;
                sap = *sal;
 
-               do {
+               for ( sai=res; sai; sai=sai->ai_next ) {
+                       if( sai->ai_addr == NULL ) {
+                               freeaddrinfo(res);
+                               goto errexit;
+                       }
+
                        switch (sai->ai_family) {
 #  ifdef LDAP_PF_INET6
                        case AF_INET6:
@@ -428,7 +433,7 @@ static int slap_get_listener_addresses(
                                (*sap)->sa_family = sai->ai_family;
                                sap++;
                        }
-               } while ((sai = sai->ai_next) != NULL);
+               }
 
                *sap = NULL;
                freeaddrinfo(res);