CTest: Fix memory leaks on error
Credit goes to "cppcheck". Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
This commit is contained in:
parent
83ce7c4d3c
commit
f47393c66b
|
@ -93,6 +93,7 @@ void cmCTestRunTest::CompressOutput()
|
||||||
ret = deflateInit(&strm, -1); //default compression level
|
ret = deflateInit(&strm, -1); //default compression level
|
||||||
if (ret != Z_OK)
|
if (ret != Z_OK)
|
||||||
{
|
{
|
||||||
|
delete[] out;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,6 +107,7 @@ void cmCTestRunTest::CompressOutput()
|
||||||
{
|
{
|
||||||
cmCTestLog(this->CTest, ERROR_MESSAGE, "Error during output "
|
cmCTestLog(this->CTest, ERROR_MESSAGE, "Error during output "
|
||||||
"compression. Sending uncompressed output." << std::endl);
|
"compression. Sending uncompressed output." << std::endl);
|
||||||
|
delete[] out;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -159,6 +159,7 @@ bool cmParsePHPCoverage::ReadFileInformation(std::ifstream& in)
|
||||||
// read open quote
|
// read open quote
|
||||||
if(in.get(c) && c != '"')
|
if(in.get(c) && c != '"')
|
||||||
{
|
{
|
||||||
|
delete[] s;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// read the string data
|
// read the string data
|
||||||
|
|
|
@ -3096,6 +3096,7 @@ bool cmCTest::CompressString(std::string& str)
|
||||||
ret = deflateInit(&strm, -1); //default compression level
|
ret = deflateInit(&strm, -1); //default compression level
|
||||||
if (ret != Z_OK)
|
if (ret != Z_OK)
|
||||||
{
|
{
|
||||||
|
delete[] out;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3109,6 +3110,7 @@ bool cmCTest::CompressString(std::string& str)
|
||||||
{
|
{
|
||||||
cmCTestLog(this, ERROR_MESSAGE, "Error during gzip compression."
|
cmCTestLog(this, ERROR_MESSAGE, "Error during gzip compression."
|
||||||
<< std::endl);
|
<< std::endl);
|
||||||
|
delete[] out;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue