mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 15:30:46 +00:00
ospfclient: Free up leaked resources in error path
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
e6fda497d3
commit
5125997a8a
@ -183,6 +183,7 @@ ospf_apiclient_connect (char *host, int syncport)
|
|||||||
fd1 = socket (AF_INET, SOCK_STREAM, 0);
|
fd1 = socket (AF_INET, SOCK_STREAM, 0);
|
||||||
if (fd1 < 0)
|
if (fd1 < 0)
|
||||||
{
|
{
|
||||||
|
close (async_server_sock);
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
"ospf_apiclient_connect: creating sync socket failed\n");
|
"ospf_apiclient_connect: creating sync socket failed\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -196,6 +197,7 @@ ospf_apiclient_connect (char *host, int syncport)
|
|||||||
{
|
{
|
||||||
fprintf (stderr, "ospf_apiclient_connect: SO_REUSEADDR failed\n");
|
fprintf (stderr, "ospf_apiclient_connect: SO_REUSEADDR failed\n");
|
||||||
close (fd1);
|
close (fd1);
|
||||||
|
close (async_server_sock);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,6 +208,7 @@ ospf_apiclient_connect (char *host, int syncport)
|
|||||||
{
|
{
|
||||||
fprintf (stderr, "ospf_apiclient_connect: SO_REUSEPORT failed\n");
|
fprintf (stderr, "ospf_apiclient_connect: SO_REUSEPORT failed\n");
|
||||||
close (fd1);
|
close (fd1);
|
||||||
|
close (async_server_sock);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif /* SO_REUSEPORT */
|
#endif /* SO_REUSEPORT */
|
||||||
@ -227,6 +230,7 @@ ospf_apiclient_connect (char *host, int syncport)
|
|||||||
{
|
{
|
||||||
fprintf (stderr, "ospf_apiclient_connect: bind sync socket failed\n");
|
fprintf (stderr, "ospf_apiclient_connect: bind sync socket failed\n");
|
||||||
close (fd1);
|
close (fd1);
|
||||||
|
close (async_server_sock);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,6 +264,7 @@ ospf_apiclient_connect (char *host, int syncport)
|
|||||||
fprintf (stderr, "ospf_apiclient_connect: accept async failed\n");
|
fprintf (stderr, "ospf_apiclient_connect: accept async failed\n");
|
||||||
close (async_server_sock);
|
close (async_server_sock);
|
||||||
close (fd1);
|
close (fd1);
|
||||||
|
close (fd2);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user