Fix copy.

This commit is contained in:
XMRig 2019-03-16 13:32:00 +07:00
parent 1b9fbf1132
commit c94c0210f7

View file

@ -178,14 +178,10 @@ void xmrig::String::copy(const char *str)
void xmrig::String::copy(const String &other)
{
if (m_size > 0) {
if (m_size == other.m_size) {
memcpy(m_data, other.m_data, m_size + 1);
if (m_size > 0 && m_size == other.m_size) {
memcpy(m_data, other.m_data, m_size + 1);
return;
}
delete [] m_data;
return;
}
delete [] m_data;