diff options
author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2022-07-06 12:49:56 +0200 |
---|---|---|
committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2022-07-06 12:49:56 +0200 |
commit | 500fe387a0e4ff474e3f85a317ac73f733dccf01 (patch) | |
tree | bf217ec0c1af779325dc4a1adebcf9e537d8d17e /bfdd/bfd_packet.c | |
parent | Merge pull request #11521 from patrasar/pimv6_drpriority (diff) | |
download | frr-500fe387a0e4ff474e3f85a317ac73f733dccf01.tar.xz frr-500fe387a0e4ff474e3f85a317ac73f733dccf01.zip |
bfdd: fix coverity scan resource leak
Close the descriptor if something fails and we don't return it.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'bfdd/bfd_packet.c')
-rw-r--r-- | bfdd/bfd_packet.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/bfdd/bfd_packet.c b/bfdd/bfd_packet.c index 6b0afef65..23778c82d 100644 --- a/bfdd/bfd_packet.c +++ b/bfdd/bfd_packet.c @@ -1569,6 +1569,7 @@ int bp_echo_socket(const struct vrf *vrf) -1) { zlog_warn("%s: setsockopt(SO_ATTACH_FILTER): %s", __func__, strerror(errno)); + close(s); return -1; } @@ -1579,6 +1580,7 @@ int bp_echo_socket(const struct vrf *vrf) if (bind(s, (struct sockaddr *)&sll, sizeof(sll)) < 0) { zlog_warn("Failed to bind echo socket: %s", safe_strerror(errno)); + close(s); return -1; } |