From ac0798db359eb0de2eae1a54b63dfaa9534984c8 Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Tue, 26 Jul 2016 10:30:50 -0400 Subject: Fix coverity warnings Change-Id: I37131f2d814a608fe9098daff83ff395f7ce99d7 Signed-off-by: Dave Barach --- vlib-api/vlibapi/api_shared.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'vlib-api/vlibapi/api_shared.c') 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) -- cgit 1.2.3-korg