libmill
libmill copied to clipboard
socket leak on tcpconnect() timeout
If I read this code right: https://github.com/sustrik/libmill/blob/2dd13ae8a1e4c9b5b89670f813a185dd51c43a66/tcp.c#L209
int rc = connect(s, (struct sockaddr*)&addr, mill_iplen(addr));
if(rc != 0) {
mill_assert(rc == -1);
if(errno != EINPROGRESS)
return NULL;
rc = fdwait(s, FDW_OUT, deadline);
if(rc == 0) {
errno = ETIMEDOUT;
return NULL;
}
On fdwait() timeout, the "s" never gets "closed()".