memcpy source can't be null.

This commit is contained in:
Bartosz Taudul 2017-09-28 20:47:57 +02:00
parent 608cb912a1
commit 556e085f2c

View File

@ -127,8 +127,11 @@ private:
m_capacity *= 2;
}
T* ptr = new T[m_capacity];
memcpy( ptr, m_ptr, m_size * sizeof( T ) );
delete[] m_ptr;
if( m_size != 0 )
{
memcpy( ptr, m_ptr, m_size * sizeof( T ) );
delete[] m_ptr;
}
m_ptr = ptr;
}