Add some missing freeaddrinfo() calls to avoid leaking memory.