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
bcdbf395bf
commit
35ad315c79
@ -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