summaryrefslogtreecommitdiffstats
path: root/vlib-api/vlibsocket/socksvr_vlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'vlib-api/vlibsocket/socksvr_vlib.c')
-rw-r--r--vlib-api/vlibsocket/socksvr_vlib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/vlib-api/vlibsocket/socksvr_vlib.c b/vlib-api/vlibsocket/socksvr_vlib.c
index eb8dd334..354c4f1c 100644
--- a/vlib-api/vlibsocket/socksvr_vlib.c
+++ b/vlib-api/vlibsocket/socksvr_vlib.c
@@ -575,12 +575,14 @@ socksvr_api_init (vlib_main_t * vm)
rv = ioctl (sockfd, FIONBIO, &one);
if (rv < 0)
{
+ close (sockfd);
return clib_error_return_unix (0, "FIONBIO");
}
rv = setsockopt (sockfd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof (one));
if (rv < 0)
{
+ close (sockfd);
return clib_error_return_unix (0, "SO_REUSEADDR");
}