diff --git a/docs/changes.txt b/docs/changes.txt index a986c14b9c..5cee0aac01 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -577,6 +577,7 @@ Major new features in this release All: - Fix wxSocket::WaitForAccept() in non-main thread (Hajo Kirchhoff). +- Fix memory overallocation in wxVector::reserve() (Nigel Paton). All (GUI): diff --git a/include/wx/vector.h b/include/wx/vector.h index dffb19fc9d..e81cafb082 100644 --- a/include/wx/vector.h +++ b/include/wx/vector.h @@ -327,7 +327,7 @@ public: if ( m_capacity + increment > n ) n = m_capacity + increment; - m_values = Ops::Realloc(m_values, n * sizeof(value_type), m_size); + m_values = Ops::Realloc(m_values, n, m_size); m_capacity = n; }