chriskohlhoff / asio

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

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

Open mpoeter opened 1 month ago

mpoeter commented 1 month 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