From 07984fa5e0ed91f6325b05f0280479d953ba16a8 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 18 Mar 2013 05:46:08 +0000 Subject: [PATCH] back port uninitialized variable access fix from libtorrent_aio --- src/torrent.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/torrent.cpp b/src/torrent.cpp index c250d8e31..187c8b897 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -7522,13 +7522,14 @@ namespace libtorrent #endif if (next_announce <= now) next_announce = now; + // don't re-issue the timer if it's the same expiration time as last time + // if m_waiting_tracker is false, expires_at() is undefined + if (m_waiting_tracker && m_tracker_timer.expires_at() == next_announce) return; + m_waiting_tracker = true; error_code ec; boost::weak_ptr self(shared_from_this()); - // don't re-issue the timer if it's the same expiration time as last time - if (m_tracker_timer.expires_at() == next_announce) return; - #if defined TORRENT_ASIO_DEBUGGING add_outstanding_async("tracker::on_tracker_announce_disp"); #endif