diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-10-09 22:08:08 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-10-10 18:31:36 +0200 |
commit | 757fd7116809590313132f981d2fbe7e3f0a5e72 (patch) | |
tree | 0c879642d79ca28c48253688fe395427255b426a /ospfd | |
parent | pimd: Fix uninited idx for argv_find (diff) | |
download | frr-757fd7116809590313132f981d2fbe7e3f0a5e72.tar.xz frr-757fd7116809590313132f981d2fbe7e3f0a5e72.zip |
ospfd: Fix leak of FD
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'ospfd')
-rw-r--r-- | ospfd/ospf_network.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ospfd/ospf_network.c b/ospfd/ospf_network.c index d1c142905..699f2341d 100644 --- a/ospfd/ospf_network.c +++ b/ospfd/ospf_network.c @@ -220,8 +220,10 @@ int ospf_sock_init(struct ospf *ospf) } ret = ospf_bind_vrfdevice(ospf, ospf_sock); - if (ret < 0) + if (ret < 0) { + close(ospf_sock); goto out; + } #ifdef IP_HDRINCL /* we will include IP header with packet */ @@ -232,6 +234,7 @@ int ospf_sock_init(struct ospf *ospf) zlog_warn("Can't set IP_HDRINCL option for fd %d: %s", ospf_sock, safe_strerror(save_errno)); + close(ospf_sock); goto out; } #elif defined(IPTOS_PREC_INTERNETCONTROL) |