1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-30 19:03:04 +00:00

fix: crash regression in tr_peerMgr::make_new_peer_connections()

This commit is contained in:
Charles Kerr 2023-07-08 09:32:20 -05:00 committed by GitHub
parent ec54e7f11e
commit 82f08420fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2533,11 +2533,13 @@ void tr_peerMgr::make_new_peer_connections()
for (size_t i = 0; i < n_this_pass; ++i)
{
auto const& [tor_id, sock_addr] = peers[i];
auto* const tor = session->torrents().get(tor_id);
auto* const atom = tor->swarm->get_existing_atom(sock_addr);
if (tor != nullptr && atom != nullptr)
if (auto* const tor = session->torrents().get(tor_id); tor != nullptr)
{
initiateConnection(this, tor->swarm, *atom);
if (auto* const atom = tor->swarm->get_existing_atom(sock_addr); atom != nullptr)
{
initiateConnection(this, tor->swarm, *atom);
}
}
}