mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 15:58:18 +00:00
zebra: Don't leak socket with failure condition
Don't leak a socket when we are unable to set it as non-blocking and warn the user as appropriate. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
90d84f92ae
commit
95c54276f7
@ -388,7 +388,13 @@ zebra_ptm_socket_init (void)
|
||||
if (sock < 0)
|
||||
return -1;
|
||||
if (set_nonblocking(sock) < 0)
|
||||
return -1;
|
||||
{
|
||||
if (IS_ZEBRA_DEBUG_EVENT)
|
||||
zlog_debug ("%s: Unable to set socket non blocking[%s]",
|
||||
__PRETTY_FUNCTION__, safe_strerror (errno));
|
||||
close (sock);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Make server socket. */
|
||||
memset (&addr, 0, sizeof (struct sockaddr_un));
|
||||
|
Loading…
Reference in New Issue
Block a user