This project is read-only.
5
Vote

Memory leaks in BitConverter

description

The following BitConverter code leaks pOutput array (skips deallocation) when the stack method call fails:
char* pOutput = ByteArrayToHex(p, 0, pArray->m_numOfElements);
TINYCLR_CHECK_HRESULT(stack.SetResult_String(pOutput));//if fails goto TinyCLR_Cleanup
delete[] pOutput;
I guess it should be changed to something like
char* pOutput = ByteArrayToHex(p, 0, pArray->m_numOfElements);
hr = stack.SetResult_String(pOutput);
delete[] pOutput;
TINYCLR_CHECK_HRESULT(hr);

comments

leforban wrote Oct 27, 2015 at 5:11 PM

It seems to be solved in 4.4 RTW. However for those who are still using 4.3... how to fix that?

wrote Oct 27, 2015 at 5:11 PM