Fix coverity warnings

Change-Id: I37131f2d814a608fe9098daff83ff395f7ce99d7
Signed-off-by: Dave Barach <dave@barachs.net>
This commit is contained in:
Dave Barach
2016-07-26 10:30:50 -04:00
parent 0f1c29c9d4
commit ac0798db35
6 changed files with 16 additions and 3 deletions

View File

@ -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)