summaryrefslogtreecommitdiffstats
path: root/vlib-api/vlibmemory/memory_vlib.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2016-07-26 10:30:50 -0400
committerDave Barach <dave@barachs.net>2016-07-26 10:31:05 -0400
commitac0798db359eb0de2eae1a54b63dfaa9534984c8 (patch)
tree6ee4810cbed91cb517629f5132a9872882439e4d /vlib-api/vlibmemory/memory_vlib.c
parent0f1c29c9d45edcc2d226a8e519db3e56888e3181 (diff)
Fix coverity warnings
Change-Id: I37131f2d814a608fe9098daff83ff395f7ce99d7 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vlib-api/vlibmemory/memory_vlib.c')
-rw-r--r--vlib-api/vlibmemory/memory_vlib.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/vlib-api/vlibmemory/memory_vlib.c b/vlib-api/vlibmemory/memory_vlib.c
index c2c14acf183..13b1121a0f4 100644
--- a/vlib-api/vlibmemory/memory_vlib.c
+++ b/vlib-api/vlibmemory/memory_vlib.c
@@ -1042,7 +1042,12 @@ vl_api_trace_print_file_cmd (vlib_main_t * vm, u32 first, u32 last,
}
msg_id = ntohs (msg_id);
- fseek (fp, -2, SEEK_CUR);
+ if (fseek (fp, -2, SEEK_CUR) < 0)
+ {
+ vlib_cli_output (vm, "fseek failed, %s", strerror(errno));
+ fclose(fp);
+ return;
+ }
/* Mild sanity check */
if (msg_id >= vec_len (am->msg_handlers))