utp close-reason use after free fix

This commit is contained in:
arvidn 2018-09-23 06:18:23 -07:00 committed by Arvid Norberg
parent 2508e2ab0f
commit 022a089b86
2 changed files with 2 additions and 1 deletions

View File

@ -1,3 +1,4 @@
* utp close-reason fix
* exposed default add_torrent_params flags to python bindings
* fix redundant flushes of partfile metadata
* add option to ignore min-interval from trackers on force-reannounce

View File

@ -1513,7 +1513,7 @@ void utp_socket_impl::parse_close_reason(boost::uint8_t const* ptr, int size)
UTP_LOGV("%8p: incoming close_reason: %d\n"
, static_cast<void*>(this), int(incoming_close_reason));
if (m_userdata == 0) return;
if (m_userdata == 0 || !m_attached) return;
utp_stream::on_close_reason(m_userdata, incoming_close_reason);
}