getlocaladdrname() would leak a socket every time it was called, which is
twice for every call to meshlink_invite() using the default flags.
}
if(connect(sock, rai->ai_addr, rai->ai_addrlen) && !sockwouldblock(errno)) {
+ closesocket(sock);
freeaddrinfo(rai);
return false;
}
socklen_t sl = sizeof(sn);
if(getsockname(sock, (struct sockaddr *)&sn, &sl)) {
+ closesocket(sock);
return false;
}
+ closesocket(sock);
+
if(getnameinfo((struct sockaddr *)&sn, sl, host, hostlen, NULL, 0, NI_NUMERICHOST | NI_NUMERICSERV)) {
return false;
}