We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7742b4e commit 4aa63aaCopy full SHA for 4aa63aa
include/cppcore/Common/TStringBase.h
@@ -158,9 +158,11 @@ template <class T>
158
inline void TStringBase<T>::copyFrom(TStringBase<T> &base, const T *ptr, size_t size) {
159
if (ptr != nullptr) {
160
T *targetPtr = base.mBuffer;
161
-
162
if (size > 0) {
163
if (size > base.mCapacity) {
+ if (base.mStringBuffer != nullptr) {
164
+ delete [] base.mStringBuffer;
165
+ }
166
base.mStringBuffer = new T[size];
167
base.mCapacity = size;
168
targetPtr = base.mStringBuffer;
0 commit comments