summaryrefslogtreecommitdiffstats
path: root/vlib-api/vlibapi
diff options
context:
space:
mode:
Diffstat (limited to 'vlib-api/vlibapi')
-rw-r--r--vlib-api/vlibapi/api_shared.c2
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)