Apply #296 ([PATCH] cppcheck leak memory when -j option uses)
http://apps.sourceforge.net/trac/cppcheck/ticket/296
This commit is contained in:
parent
63da926ed2
commit
e7cff4bc43
|
@ -191,9 +191,13 @@ void ThreadExecutor::writeToPipe(char type, const std::string &data)
|
||||||
std::memcpy(&(out[1+sizeof(len)]), data.c_str(), len);
|
std::memcpy(&(out[1+sizeof(len)]), data.c_str(), len);
|
||||||
if (write(_pipe[1], out, len + 1 + sizeof(len)) <= 0)
|
if (write(_pipe[1], out, len + 1 + sizeof(len)) <= 0)
|
||||||
{
|
{
|
||||||
|
delete [] out;
|
||||||
|
out = 0;
|
||||||
std::cerr << "#### ThreadExecutor::writeToPipe, Failed to write to pipe" << std::endl;
|
std::cerr << "#### ThreadExecutor::writeToPipe, Failed to write to pipe" << std::endl;
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete [] out;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ThreadExecutor::reportOut(const std::string &outmsg)
|
void ThreadExecutor::reportOut(const std::string &outmsg)
|
||||||
|
|
Loading…
Reference in New Issue