Merge pull request #4080

dead780f abstract_tcp_server2: fix use after free (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2018-07-03 15:24:01 +02:00
commit c58758a016
No known key found for this signature in database
GPG Key ID: 55432DF31CCD4FCD

View File

@ -653,13 +653,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())
{
try { host_count(m_host, -1); } catch (...) { /* ignore */ }
m_host = "";
}
m_was_shutdown = true;
m_protocol_handler.release_protocol();
return true;
}
//---------------------------------------------------------------------------------