Skip to content

Commit

Permalink
OrcCommand: WolfExecution: fix possible nullptr deref on error path
Browse files Browse the repository at this point in the history
  • Loading branch information
fabienfl-orc committed Dec 1, 2020
1 parent 1b963b4 commit 916f079
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/OrcCommand/WolfExecution_Execute.cpp
Expand Up @@ -741,8 +741,16 @@ HRESULT WolfExecution::TerminateAllAndComplete()
HRESULT WolfExecution::CompleteArchive(UploadMessage::ITarget* pUploadMessageQueue)
{
HRESULT hr = E_FAIL;
m_ProcessStatisticsWriter->Close();
m_JobStatisticsWriter->Close();

if (m_ProcessStatisticsWriter)
{
m_ProcessStatisticsWriter->Close();
}

if (m_JobStatisticsWriter)
{
m_JobStatisticsWriter->Close();
}

if (VerifyFileExists(m_ProcessStatisticsOutput.Path.c_str()) == S_OK)
{
Expand Down

0 comments on commit 916f079

Please sign in to comment.