From 058a3a0bd05cebcc0e92d7261c0b1a66c072c6c2 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Mon, 6 Aug 2018 09:17:36 +1000 Subject: rtemstoolkit: Various coverity related fixes. --- rtemstoolkit/rld-elf.cpp | 1 + rtemstoolkit/rld-process.cpp | 21 ++++++++++++++++++--- rtemstoolkit/rld-rtems.cpp | 1 - 3 files changed, 19 insertions(+), 4 deletions(-) (limited to 'rtemstoolkit') diff --git a/rtemstoolkit/rld-elf.cpp b/rtemstoolkit/rld-elf.cpp index ace3967..231f2bf 100644 --- a/rtemstoolkit/rld-elf.cpp +++ b/rtemstoolkit/rld-elf.cpp @@ -425,6 +425,7 @@ namespace rld archive (false), writable (false), elf_ (0), + mtype (0), oclass (0), ident_str (0), ident_size (0), diff --git a/rtemstoolkit/rld-process.cpp b/rtemstoolkit/rld-process.cpp index e91796f..30e0605 100644 --- a/rtemstoolkit/rld-process.cpp +++ b/rtemstoolkit/rld-process.cpp @@ -83,7 +83,13 @@ namespace rld temporary_files::~temporary_files () { - clean_up (); + try + { + clean_up (); + } + catch (...) + { + } } const std::string @@ -99,6 +105,9 @@ namespace rld RLD_PATH_SEPARATOR_STR); tempfile_ref ref (name, keep); tempfiles.push_back (ref); + + ::free (temp); + return name; } @@ -162,8 +171,14 @@ namespace rld tempfile::~tempfile () { - close (); - temporaries.erase (_name); + try + { + close (); + temporaries.erase (_name); + } + catch (...) + { + } } void diff --git a/rtemstoolkit/rld-rtems.cpp b/rtemstoolkit/rld-rtems.cpp index 806a2e1..a2dcf82 100644 --- a/rtemstoolkit/rld-rtems.cpp +++ b/rtemstoolkit/rld-rtems.cpp @@ -210,7 +210,6 @@ namespace rld if (slash == std::string::npos) throw rld::error ("Invalid BSP name", _arch_bsp); return _arch_bsp.substr (0, slash); - std::string bsp = _arch_bsp.substr (slash + 1); } const std::string -- cgit v1.2.3