From: Amnon Hanuhov Date: Tue, 11 May 2021 12:07:35 +0000 (+0300) Subject: crimson/net: Set add_ref to false when creating a MessageRef in conn::send() X-Git-Tag: v17.1.0~1970^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F41322%2Fhead;p=ceph.git crimson/net: Set add_ref to false when creating a MessageRef in conn::send() we should not increase the ref count when transferring the ownership from a MessageURef instance to a MessageRef instance. to address the memory leak introduced by 1f6e66470504fe5aec4cae3fc74d6e9927aae7aa. Signed-off-by: Amnon Hanuhov --- diff --git a/src/crimson/net/SocketConnection.cc b/src/crimson/net/SocketConnection.cc index 97fc76b730459..630dbdfa8c8ae 100644 --- a/src/crimson/net/SocketConnection.cc +++ b/src/crimson/net/SocketConnection.cc @@ -72,7 +72,7 @@ bool SocketConnection::peer_wins() const seastar::future<> SocketConnection::send(MessageURef msg) { assert(seastar::this_shard_id() == shard_id()); - return protocol->send(MessageRef{msg.release()}); + return protocol->send(MessageRef{msg.release(), false}); } seastar::future<> SocketConnection::send(MessageRef msg)