[kutil] Don't use delete on non-new pointers

`kutil::vector` was calling `operator delete []` on memory that had not
been allocated with `operator new []`, and so was deleting the wrong
pointer.

Tags: bug memory allocator
This commit is contained in:
Justin C. Miller
2020-05-24 19:48:03 -07:00
parent bfd13e7a9b
commit 774f6fc334

View File

@@ -61,7 +61,7 @@ public:
~vector() ~vector()
{ {
while (m_size) remove(); while (m_size) remove();
delete [] m_elements; m_alloc.free(m_elements);
} }
/// Get the size of the array. /// Get the size of the array.