X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fos.c;h=9a450a8656c98fe35df7206bc9e5bb7cbf855c8e;hb=a746f186fdd8b3b6561919177b6dd011c2b177e4;hp=ae9c6043cdb1f81e74852acf55b116ada20658f7;hpb=7d8d08c484958a90f5d5744894b9bc2f723bee4e;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/os.c b/src/src/os.c index ae9c6043c..9a450a865 100644 --- a/src/src/os.c +++ b/src/src/os.c @@ -495,9 +495,11 @@ if (getifaddrs(&ifalist) != 0) for (struct ifaddrs * ifa = ifalist; ifa; ifa = ifa->ifa_next) { - if (ifa->ifa_addr->sa_family != AF_INET + struct sockaddr * ifa_addr = ifa->ifa_addr; + if (!ifa_addr) continue; + if (ifa_addr->sa_family != AF_INET #if HAVE_IPV6 - && ifa->ifa_addr->sa_family != AF_INET6 + && ifa_addr->sa_family != AF_INET6 #endif /* HAVE_IPV6 */ ) continue; @@ -511,9 +513,9 @@ for (struct ifaddrs * ifa = ifalist; ifa; ifa = ifa->ifa_next) next = store_get(sizeof(ip_address_item), FALSE); next->next = NULL; next->port = 0; - (void)host_ntoa(-1, ifa->ifa_addr, next->address, NULL); + (void)host_ntoa(-1, ifa_addr, next->address, NULL); - if (yield == NULL) + if (!yield) yield = last = next; else {