aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vapi/vapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vpp-api/vapi/vapi.c')
-rw-r--r--src/vpp-api/vapi/vapi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vpp-api/vapi/vapi.c b/src/vpp-api/vapi/vapi.c
index 26c5708342f..61801fc3726 100644
--- a/src/vpp-api/vapi/vapi.c
+++ b/src/vpp-api/vapi/vapi.c
@@ -927,6 +927,7 @@ vapi_sock_client_disconnect (vapi_ctx_t ctx)
}
clib_socket_close (&ctx->client_socket);
+ clib_socket_free (&ctx->client_socket);
vapi_api_name_and_crc_free (ctx);
return VAPI_OK;
}
@@ -987,7 +988,7 @@ vapi_connect_ex (vapi_ctx_t ctx, const char *name, const char *path,
if (use_uds)
{
- if (vapi_sock_client_connect (ctx, (char *) path, name) < 0)
+ if (vapi_sock_client_connect (ctx, (char *) path, name) != VAPI_OK)
{
return VAPI_ECON_FAIL;
}
@@ -1358,6 +1359,7 @@ vapi_sock_disconnect (vapi_ctx_t ctx)
}
fail:
clib_socket_close (&ctx->client_socket);
+ clib_socket_free (&ctx->client_socket);
vapi_api_name_and_crc_free (ctx);
ctx->connected = false;