From c94c0210f74f48a5a634d4df35de11a7ddf61384 Mon Sep 17 00:00:00 2001 From: XMRig Date: Sat, 16 Mar 2019 13:32:00 +0700 Subject: [PATCH] Fix copy. --- src/base/tools/String.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/base/tools/String.cpp b/src/base/tools/String.cpp index 7ed61d01f..9884f0aca 100644 --- a/src/base/tools/String.cpp +++ b/src/base/tools/String.cpp @@ -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;