diff options
author | Dave Barach <dave@barachs.net> | 2016-08-05 10:10:18 -0400 |
---|---|---|
committer | Dave Barach <dave@barachs.net> | 2016-08-05 10:10:38 -0400 |
commit | f9c231ec12c2233557bfbb58feb87a1fcddf224a (patch) | |
tree | 6ee8846be9a6c79d68d0364c00cc58b2f3547ddd /vppinfra/tools/elftool.c | |
parent | 56faee837281c7f9c28aa40dbf0f6e4620b76be8 (diff) |
vpp-189 Clean up more coverity warnings
Time to make the donuts
Change-Id: I528937800f7daefce19723dda0216e58d857942c
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vppinfra/tools/elftool.c')
-rw-r--r-- | vppinfra/tools/elftool.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/vppinfra/tools/elftool.c b/vppinfra/tools/elftool.c index f5d70b56d5f..d9d3704b4a3 100644 --- a/vppinfra/tools/elftool.c +++ b/vppinfra/tools/elftool.c @@ -358,10 +358,12 @@ set_interpreter_rpath (elf_tool_main_t * tm) } done: - if (mmap_length > 0) + if (mmap_length > 0 && idp) munmap (idp, mmap_length); - close (ifd); - close (ofd); + if (ifd >= 0) + close (ifd); + if (ofd >= 0) + close (ofd); return error; } @@ -408,7 +410,10 @@ int main (int argc, char * argv[]) } if (! tm->input_file) - clib_error ("no input file"); + { + error = clib_error_return (0, "no input file"); + goto done; + } /* Do the typical case a stone-simple way... */ if (tm->quiet && tm->set_interpreter && tm->set_rpath && tm->output_file) |