Fix memory and process leak in ctest_run_script.
This commit is contained in:
parent
0b49e4ad1e
commit
cdb966532b
|
@ -273,7 +273,6 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg)
|
|||
// Properly handle output of the build command
|
||||
cmsysProcess_WaitForExit(cp, 0);
|
||||
int result = cmsysProcess_GetState(cp);
|
||||
|
||||
int retVal = 0;
|
||||
bool failed = false;
|
||||
if(result == cmsysProcess_State_Exited)
|
||||
|
@ -300,6 +299,7 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg)
|
|||
<< cmsysProcess_GetErrorString(cp) << std::endl);
|
||||
failed = true;
|
||||
}
|
||||
cmsysProcess_Delete(cp);
|
||||
if(failed)
|
||||
{
|
||||
cmOStringStream message;
|
||||
|
|
Loading…
Reference in New Issue