aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/maplog.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-12-12 08:29:42 -0500
committerFlorin Coras <florin.coras@gmail.com>2017-12-13 00:12:29 +0000
commit129e80e32abb0999b069a2175fbb64635f311ed0 (patch)
tree2a4291ec8475aae8c536f569814ef7d43b670b8c /src/vppinfra/maplog.c
parent3ea6ce235e9a9af1e78208eef54304ef0c865e67 (diff)
VPP-1032: fix coverity warnings
Change-Id: Ic551af286aa84293deb260560c12def430449598 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vppinfra/maplog.c')
-rw-r--r--src/vppinfra/maplog.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vppinfra/maplog.c b/src/vppinfra/maplog.c
index 3e08973bc8c..158361b0bda 100644
--- a/src/vppinfra/maplog.c
+++ b/src/vppinfra/maplog.c
@@ -415,6 +415,7 @@ clib_maplog_process (char *file_basename, void *fp_arg)
file_baseva =
mmap (0, file_size_in_bytes, PROT_READ, MAP_SHARED, fd, 0);
(void) close (fd);
+ fd = -1;
if (file_baseva == (u8 *) MAP_FAILED)
{
clib_unix_warning ("mmap");
@@ -439,7 +440,7 @@ clib_maplog_process (char *file_basename, void *fp_arg)
}
out:
- if (fd > 0)
+ if (fd >= 0)
(void) close (fd);
vec_free (this_filename);