Fix mismatched new[] vs free() in Altium parser

This commit is contained in:
Jon Evans 2024-03-05 23:09:38 -05:00
parent 4bc69183ab
commit 4ffbef5e42
1 changed files with 2 additions and 1 deletions

View File

@ -147,9 +147,10 @@ public:
wxScopedCharBuffer ReadCharBuffer()
{
uint8_t len = Read<uint8_t>();
if( GetRemainingBytes() >= len )
{
char* buf = new char[len];
char* buf = static_cast<char*>( malloc( len ) );
memcpy( buf, m_pos, len );
m_pos += len;