From 82570bbd638022ace2f29fd43c54ddf9e5ce574d Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Wed, 21 Jan 2026 16:57:50 +0100 Subject: [PATCH] MT#59962 tcp_trsp: move new sock to connections map Instead of copying, move that. And then later for the local socket assignment operations use a copy connections map member used as a destination shortly before. Closes Coverity CID 642750. Change-Id: Ief7891c1962251b33cd5960e74e4081685881dcf --- core/sip/tcp_trsp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/sip/tcp_trsp.cpp b/core/sip/tcp_trsp.cpp index 83c02b12..eb3ca554 100644 --- a/core/sip/tcp_trsp.cpp +++ b/core/sip/tcp_trsp.cpp @@ -536,9 +536,9 @@ int tcp_server_worker::send(const sockaddr_storage* sa, const char* msg, else { //TODO: add flags to avoid new connections (ex: UAs behind NAT) auto new_sock = tcp_trsp_socket::new_connection(server_sock, *this, sa, evbase); - connections[dest] = new_sock; + connections[dest] = new_sock; // copy - sock = new_sock; + sock = std::move(new_sock); new_conn = true; } connections_mut.unlock();