mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-10 16:42:44 +00:00
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>
This commit is contained in:
parent
d1757dd5cd
commit
500fe387a0
@ -1569,6 +1569,7 @@ int bp_echo_socket(const struct vrf *vrf)
|
|||||||
-1) {
|
-1) {
|
||||||
zlog_warn("%s: setsockopt(SO_ATTACH_FILTER): %s", __func__,
|
zlog_warn("%s: setsockopt(SO_ATTACH_FILTER): %s", __func__,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
close(s);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1579,6 +1580,7 @@ int bp_echo_socket(const struct vrf *vrf)
|
|||||||
if (bind(s, (struct sockaddr *)&sll, sizeof(sll)) < 0) {
|
if (bind(s, (struct sockaddr *)&sll, sizeof(sll)) < 0) {
|
||||||
zlog_warn("Failed to bind echo socket: %s",
|
zlog_warn("Failed to bind echo socket: %s",
|
||||||
safe_strerror(errno));
|
safe_strerror(errno));
|
||||||
|
close(s);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user