diff --git a/CHANGELOG.md b/CHANGELOG.md index 26ac09ac..0b5a9506 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Version 261: * Fix UB in websocket read tests * Remove redundant includes in websocket * Simplify websocket::detail::prng +* Don't over-allocate in http::basic_fields -------------------------------------------------------------------------------- diff --git a/include/boost/beast/http/fields.hpp b/include/boost/beast/http/fields.hpp index f891acb1..24b1a122 100644 --- a/include/boost/beast/http/fields.hpp +++ b/include/boost/beast/http/fields.hpp @@ -196,7 +196,7 @@ private: using rebind_type = typename beast::detail::allocator_traits:: - template rebind_alloc; + template rebind_alloc; using alloc_traits = beast::detail::allocator_traits; diff --git a/include/boost/beast/http/impl/fields.hpp b/include/boost/beast/http/impl/fields.hpp index 0fa3bedd..0788e59e 100644 --- a/include/boost/beast/http/impl/fields.hpp +++ b/include/boost/beast/http/impl/fields.hpp @@ -990,8 +990,8 @@ delete_element(element& e) (sizeof(element) + e.off_ + e.len_ + 2 + sizeof(align_type) - 1) / sizeof(align_type); e.~element(); - alloc_traits::deallocate(a, &e, n); - //reinterpret_cast(&e), n); + alloc_traits::deallocate(a, + reinterpret_cast(&e), n); } template