Skip to content

Commit

Permalink
fix use-after-free
Browse files Browse the repository at this point in the history
  • Loading branch information
tearfur committed Jun 20, 2023
1 parent ab7b5f9 commit 54af6db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libtransmission/peer-mgr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1118,8 +1118,9 @@ void tr_peerMgrAddIncoming(tr_peerMgr* manager, tr_peer_socket&& socket)
}
else /* we don't have a connection to them yet... */
{
auto const& socket_address = socket.socketAddress();
manager->incoming_handshakes.try_emplace(
socket.socketAddress(),
socket_address,
&manager->handshake_mediator_,
tr_peerIo::new_incoming(session, &session->top_bandwidth_, std::move(socket)),
session->encryptionMode(),
Expand Down

0 comments on commit 54af6db

Please sign in to comment.