fix segfault from freeaddrinfo