Skip to content

Commit

Permalink
Clean up allocated memory on error in CordbEval::NewParameterizedObje…
Browse files Browse the repository at this point in the history
…ct (dotnet#50371)

pArgData is allocated in this piece of code; if we are failing and
returning early, we should deallocate this memory to avoid a memory
leak.
  • Loading branch information
omajid authored Mar 30, 2021
1 parent 4f62f32 commit 2175996
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/coreclr/debug/di/rsthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9790,6 +9790,7 @@ HRESULT CordbEval::NewParameterizedObject(ICorDebugFunction * pConstructor,

if (FAILED(hr))
{
delete [] pArgData;
return hr;
}
}
Expand Down

0 comments on commit 2175996

Please sign in to comment.