diff --git a/libtorrent/src/connection_queue.cpp b/libtorrent/src/connection_queue.cpp index 473a92920..859205ed0 100644 --- a/libtorrent/src/connection_queue.cpp +++ b/libtorrent/src/connection_queue.cpp @@ -159,7 +159,7 @@ namespace libtorrent ptime next_expire = max_time(); ptime now = time_now(); for (std::list::iterator i = m_queue.begin(); - i != m_queue.end();) + !m_queue.empty() && i != m_queue.end();) { if (i->connecting && i->expires < now) {