Apply #296 ([PATCH] cppcheck leak memory when -j option uses)

http://apps.sourceforge.net/trac/cppcheck/ticket/296
This commit is contained in:
Reijo Tomperi 2009-05-09 22:40:22 +03:00
parent 63da926ed2
commit e7cff4bc43
1 changed files with 4 additions and 0 deletions

View File

@ -191,9 +191,13 @@ void ThreadExecutor::writeToPipe(char type, const std::string &data)
std::memcpy(&(out[1+sizeof(len)]), data.c_str(), len);
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;
exit(0);
}
delete [] out;
}
void ThreadExecutor::reportOut(const std::string &outmsg)