- char *tmp = new char[len + 1];
- m_input->Read(tmp, len);
- tmp[len] = 0;
- wxString ret( (const wxChar*) m_conv.cMB2WX(tmp) );
- delete[] tmp;
+ wxCharBuffer tmp(len + 1);
+ m_input->Read(tmp.data(), len);
+ tmp.data()[len] = '\0';
+ wxString ret(m_conv.cMB2WX(tmp.data()));