diff options
Diffstat (limited to 'lib/roken/getaddrinfo.c')
| -rw-r--r-- | lib/roken/getaddrinfo.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/roken/getaddrinfo.c b/lib/roken/getaddrinfo.c index c8ed95413fe3..ae21bf11090c 100644 --- a/lib/roken/getaddrinfo.c +++ b/lib/roken/getaddrinfo.c @@ -188,7 +188,7 @@ get_null (const struct addrinfo *hints, struct addrinfo *first = NULL; struct addrinfo **current = &first; int family = PF_UNSPEC; - int ret; + int ret = 0; if (hints != NULL) family = hints->ai_family; @@ -209,6 +209,8 @@ get_null (const struct addrinfo *hints, if (family == PF_INET6 || family == PF_UNSPEC) { ret = add_one (port, protocol, socktype, ¤t, const_v6, &v6_addr, NULL); + if (ret) + return ret; } #endif if (family == PF_INET || family == PF_UNSPEC) { @@ -216,7 +218,7 @@ get_null (const struct addrinfo *hints, ¤t, const_v4, &v4_addr, NULL); } *res = first; - return 0; + return ret; } static int |
