diff options
Diffstat (limited to 'lib/libc/net/getaddrinfo.c')
-rw-r--r-- | lib/libc/net/getaddrinfo.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c index 79b07de..dd85243 100644 --- a/lib/libc/net/getaddrinfo.c +++ b/lib/libc/net/getaddrinfo.c @@ -766,6 +766,10 @@ explore_numeric_scope(pai, hostname, servname, res) #ifdef INET6 case AF_INET6: scope = if_nametoindex(cp); + if (scope == 0) { + error = EAI_SYSTEM; + goto free; + } break; #endif } @@ -784,6 +788,9 @@ explore_numeric_scope(pai, hostname, servname, res) } } +#ifdef INET6 +free: +#endif free(hostname2); return error; |