From 87f5778434c5b5b774cb2c68d1bd09520061d554 Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Tue, 4 Nov 2025 23:43:08 +1100 Subject: [PATCH] Fix memory leak in ssl::detail::engine move assignment. --- include/boost/asio/ssl/detail/impl/engine.ipp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/boost/asio/ssl/detail/impl/engine.ipp b/include/boost/asio/ssl/detail/impl/engine.ipp index 57933108..71a91f9e 100644 --- a/include/boost/asio/ssl/detail/impl/engine.ipp +++ b/include/boost/asio/ssl/detail/impl/engine.ipp @@ -101,6 +101,12 @@ engine& engine::operator=(engine&& other) noexcept { if (this != &other) { + if (ssl_ && SSL_get_app_data(ssl_)) + { + delete static_cast(SSL_get_app_data(ssl_)); + SSL_set_app_data(ssl_, 0); + } + if (ext_bio_) ::BIO_free(ext_bio_);