From 556e085f2c61bca5b9977da6ec14c43a8adecee9 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 28 Sep 2017 20:47:57 +0200 Subject: [PATCH] memcpy source can't be null. --- server/TracyVector.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/TracyVector.hpp b/server/TracyVector.hpp index cf693c51..7e63f05a 100755 --- a/server/TracyVector.hpp +++ b/server/TracyVector.hpp @@ -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; }