diff --git a/src/core/alloc_type.hpp b/src/core/alloc_type.hpp index b95fc79ee7..4451f04795 100644 --- a/src/core/alloc_type.hpp +++ b/src/core/alloc_type.hpp @@ -102,6 +102,7 @@ public: if (this->count < count) { free(this->buffer); this->buffer = MallocT(count); + this->count = count; } return this->buffer; } @@ -118,6 +119,7 @@ public: if (this->count < count) { free(this->buffer); this->buffer = CallocT(count); + this->count = count; } else { memset(this->buffer, 0, sizeof(T) * count); }