bsnmp: don't leak snmp_client.fd in open_client_udp(..) on connect(2) failure
MFC after: 1 week Sponsored by: Dell EMC Isilon
This commit is contained in:
parent
f5b9907c86
commit
7583dc2785
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=315641
@ -947,6 +947,8 @@ open_client_udp(const char *host, const char *port)
|
||||
if ((res = res->ai_next) == NULL) {
|
||||
seterr(&snmp_client, "%s", strerror(errno));
|
||||
freeaddrinfo(res0);
|
||||
(void)close(snmp_client.fd);
|
||||
snmp_client.fd = -1;
|
||||
return (-1);
|
||||
}
|
||||
} else
|
||||
|
Loading…
Reference in New Issue
Block a user