From e78265738dc7d5c564bd79851df3e809de733037 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sat, 29 Sep 2001 06:33:54 +0000 Subject: [PATCH] Rework getaddrinfo() stuff for ai_addr == NULL --- servers/slapd/daemon.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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); -- 2.39.5