diff options
author | Dave Barach <dave@barachs.net> | 2016-07-26 10:30:50 -0400 |
---|---|---|
committer | Dave Barach <dave@barachs.net> | 2016-07-26 10:31:05 -0400 |
commit | ac0798db359eb0de2eae1a54b63dfaa9534984c8 (patch) | |
tree | 6ee4810cbed91cb517629f5132a9872882439e4d /vlib-api/vlibapi/api_shared.c | |
parent | 0f1c29c9d45edcc2d226a8e519db3e56888e3181 (diff) |
Fix coverity warnings
Change-Id: I37131f2d814a608fe9098daff83ff395f7ce99d7
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vlib-api/vlibapi/api_shared.c')
-rw-r--r-- | vlib-api/vlibapi/api_shared.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/vlib-api/vlibapi/api_shared.c b/vlib-api/vlibapi/api_shared.c index 18b189e1837..66f894b4edf 100644 --- a/vlib-api/vlibapi/api_shared.c +++ b/vlib-api/vlibapi/api_shared.c @@ -780,6 +780,7 @@ vl_msg_api_process_file (vlib_main_t * vm, u8 * filename, if (!(statb.st_mode & S_IFREG) || (statb.st_size < sizeof (*hp))) { vlib_cli_output (vm, "File not plausible: %s\n", filename); + close(fd); return; } @@ -814,6 +815,7 @@ vl_msg_api_process_file (vlib_main_t * vm, u8 * filename, { vlib_cli_output (vm, "Range (%d, %d) outside file range (0, %d)\n", first_index, last_index, nitems - 1); + munmap (hp, file_size); return; } if (hp->wrapped) |