rtemstoolkit: Various coverity related fixes.

This commit is contained in:
Chris Johns
2018-08-06 09:17:36 +10:00
parent 5d957c9c51
commit 058a3a0bd0
3 changed files with 19 additions and 4 deletions

View File

@@ -425,6 +425,7 @@ namespace rld
archive (false),
writable (false),
elf_ (0),
mtype (0),
oclass (0),
ident_str (0),
ident_size (0),

View File

@@ -82,9 +82,15 @@ namespace rld
}
temporary_files::~temporary_files ()
{
try
{
clean_up ();
}
catch (...)
{
}
}
const std::string
temporary_files::get (const std::string& suffix, bool keep)
@@ -99,6 +105,9 @@ namespace rld
RLD_PATH_SEPARATOR_STR);
tempfile_ref ref (name, keep);
tempfiles.push_back (ref);
::free (temp);
return name;
}
@@ -161,10 +170,16 @@ namespace rld
}
tempfile::~tempfile ()
{
try
{
close ();
temporaries.erase (_name);
}
catch (...)
{
}
}
void
tempfile::open (bool writable)

View File

@@ -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