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:
ngie 2017-03-20 17:17:54 +00:00
parent bcdbf395bf
commit 35ad315c79

View File

@ -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