Skip to content

Commit 5c19ba4

Browse files
committed
Memory leak fixed
1 parent 695dc53 commit 5c19ba4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

development/src/GXBytebuffer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,11 @@ void CGXByteBuffer::Set(const void* pSource, unsigned long count)
309309
{
310310
m_Capacity += count + VECTOR_CAPACITY;
311311
}
312+
313+
if (m_Data != NULL)
314+
{
315+
free(m_Data);
316+
}
312317
m_Data = (unsigned char*)realloc(m_Data, m_Capacity);
313318
}
314319
memcpy(m_Data + m_Size, pSource, count);

0 commit comments

Comments
 (0)