From 6eaa228b16e3c214b00873d03d8fb1f8810f72dc Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Fri, 29 Jun 2018 15:40:19 +0100 Subject: [PATCH] abstract_tcp_server2: fix use after free --- contrib/epee/include/net/abstract_tcp_server2.inl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/epee/include/net/abstract_tcp_server2.inl b/contrib/epee/include/net/abstract_tcp_server2.inl index fa39be5eb..b0d1be594 100644 --- a/contrib/epee/include/net/abstract_tcp_server2.inl +++ b/contrib/epee/include/net/abstract_tcp_server2.inl @@ -652,13 +652,13 @@ PRAGMA_WARNING_DISABLE_VS(4355) m_timer.cancel(); boost::system::error_code ignored_ec; socket_.shutdown(boost::asio::ip::tcp::socket::shutdown_both, ignored_ec); - m_was_shutdown = true; - m_protocol_handler.release_protocol(); if (!m_host.empty()) { host_count(m_host, -1); m_host = ""; } + m_was_shutdown = true; + m_protocol_handler.release_protocol(); return true; } //---------------------------------------------------------------------------------