Merge pull request #4777 from soloestoy/avoid-double-close

anet: avoid double close
This commit is contained in:
Salvatore Sanfilippo 2018-03-22 16:22:32 +01:00 committed by GitHub
commit b38f52169b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -484,7 +484,7 @@ static int _anetTcpServer(char *err, int port, char *bindaddr, int af, int backl
if (af == AF_INET6 && anetV6Only(err,s) == ANET_ERR) goto error;
if (anetSetReuseAddr(err,s) == ANET_ERR) goto error;
if (anetListen(err,s,p->ai_addr,p->ai_addrlen,backlog) == ANET_ERR) goto error;
if (anetListen(err,s,p->ai_addr,p->ai_addrlen,backlog) == ANET_ERR) s = ANET_ERR;
goto end;
}
if (p == NULL) {