diff options
author | Dave Barach <dave@barachs.net> | 2016-07-27 10:00:58 -0400 |
---|---|---|
committer | Dave Barach <dave@barachs.net> | 2016-07-27 11:15:44 -0400 |
commit | b2a6e25067a41def7d5795df6d07231b55051ab2 (patch) | |
tree | b48ea3d18dd04c71f757daceeae3f03f67f12a47 /vlib-api | |
parent | 5afccb2578d767e3a2be4316211ff38006c336a6 (diff) |
VPP-189 coverity warning cleanups
Change-Id: Ia4fbf4352119504e022b89d10d44a5259d94f316
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vlib-api')
-rw-r--r-- | vlib-api/vlibapi/api_shared.c | 1 | ||||
-rw-r--r-- | vlib-api/vlibsocket/sockclnt_vlib.c | 1 | ||||
-rw-r--r-- | vlib-api/vlibsocket/socksvr_vlib.c | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/vlib-api/vlibapi/api_shared.c b/vlib-api/vlibapi/api_shared.c index 66f894b4..09502c69 100644 --- a/vlib-api/vlibapi/api_shared.c +++ b/vlib-api/vlibapi/api_shared.c @@ -774,6 +774,7 @@ vl_msg_api_process_file (vlib_main_t * vm, u8 * filename, if (fstat (fd, &statb) < 0) { vlib_cli_output (vm, "Couldn't stat %s\n", filename); + close (fd); return; } diff --git a/vlib-api/vlibsocket/sockclnt_vlib.c b/vlib-api/vlibsocket/sockclnt_vlib.c index 4ae274c2..e8d749c5 100644 --- a/vlib-api/vlibsocket/sockclnt_vlib.c +++ b/vlib-api/vlibsocket/sockclnt_vlib.c @@ -107,6 +107,7 @@ sockclnt_open_index (char *client_name, char *hostname, int port) if (connect (sockfd, (const void *) &serv_addr, sizeof (serv_addr)) < 0) { clib_unix_warning ("Connect failure to (%s, %d)", hostname, port); + close(sockfd); return ~0; } diff --git a/vlib-api/vlibsocket/socksvr_vlib.c b/vlib-api/vlibsocket/socksvr_vlib.c index 91c6bfde..eb8dd334 100644 --- a/vlib-api/vlibsocket/socksvr_vlib.c +++ b/vlib-api/vlibsocket/socksvr_vlib.c @@ -602,6 +602,7 @@ socksvr_api_init (vlib_main_t * vm) if (bind (sockfd, (struct sockaddr *) &serv_addr, sizeof (serv_addr)) < 0) { + close (sockfd); return clib_error_return_unix (0, "bind"); } |