From: Kurt Zeilenga Date: Sat, 29 Sep 2001 06:33:54 +0000 (+0000) Subject: Rework getaddrinfo() stuff for ai_addr == NULL X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1031 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e78265738dc7d5c564bd79851df3e809de733037;p=openldap Rework getaddrinfo() stuff for ai_addr == NULL --- diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index 461e949c18..e24360c56c 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -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);