id summary reporter owner description type status milestone component version severity resolution keywords cc 2910 asio & ssl - leaking io_handler when user-provided handler throws Paul Groke chris_kohlhoff "The function boost::asio::ssl::detail::openssl_stream_service::io_handler<>::handler_impl isn't exception safe, and therefor leaks, if the invoked user-provided handler throws. Since many people bind shared_ptr<>s into their handlers, this will also keep alive their session objects. I'd consider this a major issue. (Please feel free to raise the priority to show-stopper if you think that's appropriate :-) The current implementation (1.38.0 & trunk at the moment of filing this ticket) looks like this: {{{ void handler_impl(const boost::system::error_code& error, size_t size) { handler_(error, size); delete this; } }}} Fix should be obvious: {{{ #include // for std::auto_ptr<> // ... void handler_impl(const boost::system::error_code& error, size_t size) { std::auto_ptr guard(this); // or something similar handler_(error, size); } }}} " Bugs closed Boost 1.39.0 asio Boost 1.38.0 Problem fixed asio ssl handler io_handler leak throw throws delete openssl_stream_service