summaryrefslogtreecommitdiffstats
path: root/pimd/pim_pim.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-09-08 21:02:07 +0200
committerDonald Sharp <sharpd@cumulusnetwroks.com>2016-05-26 02:38:33 +0200
commit2cd32c6114558522fdb71eff664594aa6f312bf3 (patch)
treebcf237584e1203911918dbe20ce8fa1f0ed26202 /pimd/pim_pim.c
parentbuild: Enable vtysh and pimd as part of default build (diff)
downloadfrr-2cd32c6114558522fdb71eff664594aa6f312bf3.tar.xz
frr-2cd32c6114558522fdb71eff664594aa6f312bf3.zip
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>
Diffstat (limited to 'pimd/pim_pim.c')
-rw-r--r--pimd/pim_pim.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c
index 41c26a888..cd8a29031 100644
--- a/pimd/pim_pim.c
+++ b/pimd/pim_pim.c
@@ -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;
}