summaryrefslogtreecommitdiffstats
path: root/vlib-api/vlibsocket
diff options
context:
space:
mode:
Diffstat (limited to 'vlib-api/vlibsocket')
-rw-r--r--vlib-api/vlibsocket/sockclnt_vlib.c1
-rw-r--r--vlib-api/vlibsocket/socksvr_vlib.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/vlib-api/vlibsocket/sockclnt_vlib.c b/vlib-api/vlibsocket/sockclnt_vlib.c
index d173c860ea2..4ae274c228e 100644
--- a/vlib-api/vlibsocket/sockclnt_vlib.c
+++ b/vlib-api/vlibsocket/sockclnt_vlib.c
@@ -114,6 +114,7 @@ sockclnt_open_index (char *client_name, char *hostname, int port)
if (rv < 0)
{
clib_unix_warning ("FIONBIO");
+ close(sockfd);
return ~0;
}
diff --git a/vlib-api/vlibsocket/socksvr_vlib.c b/vlib-api/vlibsocket/socksvr_vlib.c
index e70124d3a57..91c6bfde674 100644
--- a/vlib-api/vlibsocket/socksvr_vlib.c
+++ b/vlib-api/vlibsocket/socksvr_vlib.c
@@ -608,6 +608,7 @@ socksvr_api_init (vlib_main_t * vm)
rv = listen (sockfd, 5);
if (rv < 0)
{
+ close(sockfd);
return clib_error_return_unix (0, "listen");
}