summaryrefslogtreecommitdiff
path: root/ospfclient/ospf_apiclient.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-06-15 16:22:42 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-06-15 16:22:42 +0200
commitf43cd318b26a3dc57a0e6f40bcccdd5ce1886432 (patch)
treeeed2449282c488b77e1dc45b0e10c7d2ab34c45b /ospfclient/ospf_apiclient.c
parentffef22509f2a0aafcfecd56f00d75917e9139dc5 (diff)
parent68fc8f1f26e44aaaac9b39421519863e5b18bc7a (diff)
Merge pull request #711 ("Coverity munging")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'ospfclient/ospf_apiclient.c')
-rw-r--r--ospfclient/ospf_apiclient.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ospfclient/ospf_apiclient.c b/ospfclient/ospf_apiclient.c
index 0ebae087e3..3f3b5511a2 100644
--- a/ospfclient/ospf_apiclient.c
+++ b/ospfclient/ospf_apiclient.c
@@ -183,6 +183,7 @@ ospf_apiclient_connect (char *host, int syncport)
fd1 = socket (AF_INET, SOCK_STREAM, 0);
if (fd1 < 0)
{
+ close (async_server_sock);
fprintf (stderr,
"ospf_apiclient_connect: creating sync socket failed\n");
return NULL;
@@ -196,6 +197,7 @@ ospf_apiclient_connect (char *host, int syncport)
{
fprintf (stderr, "ospf_apiclient_connect: SO_REUSEADDR failed\n");
close (fd1);
+ close (async_server_sock);
return NULL;
}
@@ -206,6 +208,7 @@ ospf_apiclient_connect (char *host, int syncport)
{
fprintf (stderr, "ospf_apiclient_connect: SO_REUSEPORT failed\n");
close (fd1);
+ close (async_server_sock);
return NULL;
}
#endif /* SO_REUSEPORT */
@@ -227,6 +230,7 @@ ospf_apiclient_connect (char *host, int syncport)
{
fprintf (stderr, "ospf_apiclient_connect: bind sync socket failed\n");
close (fd1);
+ close (async_server_sock);
return NULL;
}
@@ -260,6 +264,7 @@ ospf_apiclient_connect (char *host, int syncport)
fprintf (stderr, "ospf_apiclient_connect: accept async failed\n");
close (async_server_sock);
close (fd1);
+ close (fd2);
return NULL;
}