From 2ea985325fc608d30cefda7777cd5c84a34514ad Mon Sep 17 00:00:00 2001 From: Amnon Hanuhov Date: Tue, 11 May 2021 15:07:35 +0300 Subject: [PATCH] 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 --- src/crimson/net/SocketConnection.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crimson/net/SocketConnection.cc b/src/crimson/net/SocketConnection.cc index 97fc76b73045..630dbdfa8c8a 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) -- 2.47.3