From d22a9dd64a0326cbbc5d6550d0bc9f82a30de34a Mon Sep 17 00:00:00 2001 From: John Sully Date: Wed, 22 Dec 2021 18:41:50 -0500 Subject: [PATCH] Fix memory leak Former-commit-id: c5b9adf47e30658359071d458cfb16a094dc8e28 --- src/replication.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/replication.cpp b/src/replication.cpp index f6b130f54..6be36c811 100644 --- a/src/replication.cpp +++ b/src/replication.cpp @@ -2213,6 +2213,7 @@ void saveMasterStatusToStorage() } } g_pserver->metadataDb->insert("repl-masters", 12, (void*)val, sdslen(val), true); + sdsfree(val); } /* Change the current instance replication ID with a new, random one. @@ -5729,4 +5730,4 @@ void trimReplicationBacklog() { serverLog(LL_NOTICE, "Reclaiming %lld replication backlog bytes", g_pserver->repl_backlog_size - g_pserver->repl_backlog_config_size); resizeReplicationBacklog(g_pserver->repl_backlog_config_size); -} \ No newline at end of file +}