if (fstat (fd, &statb) < 0)
{
vlib_cli_output (vm, "Couldn't stat %s\n", filename);
+ close (fd);
return;
}
if (!(statb.st_mode & S_IFREG) || (statb.st_size < sizeof (*hp)))
{
vlib_cli_output (vm, "File not plausible: %s\n", filename);
+ close(fd);
return;
}
{
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)