pimd: Fix leaked fd

When caling pim_sock_open if the failure cause happens, however
unlikely, don't leak the fd on failure.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2015-09-08 15:02:07 -04:00 committed by Donald Sharp
parent f0646db01d
commit 2cd32c6114

View File

@ -371,6 +371,7 @@ static int pim_sock_open(struct in_addr ifaddr, int ifindex)
return -1;
if (pim_socket_join(fd, qpim_all_pim_routers_addr, ifaddr, ifindex)) {
close(fd);
return -2;
}