chriskohlhoff / asio

Asio C++ Library
http://think-async.com/Asio
4.97k stars 1.22k forks source link

Leak in move-assignment of ssl::detail::engine #1474

Open mpoeter opened 6 months ago

mpoeter commented 6 months ago

The move/assignment operator of asio::ssl::detail::engine looks as follows: https://github.com/chriskohlhoff/asio/blob/12e0ce9e0500bf0f247dbd1ae894272656456079/asio/include/asio/ssl/detail/impl/engine.ipp#L99-L109

We take over ssl_ and ext_bio_ from other and reset them in other, but we simply overwrite our own members without releasing anything. In the destructor we can see what is missing here https://github.com/chriskohlhoff/asio/blob/12e0ce9e0500bf0f247dbd1ae894272656456079/asio/include/asio/ssl/detail/impl/engine.ipp#L84-L97