From beb94c901e814f63fe1170d72104c81d62fa663a Mon Sep 17 00:00:00 2001 From: Binbin Date: Wed, 9 Feb 2022 13:33:24 +0800 Subject: [PATCH] Fix INFO SENTINEL memory leak (#10268) * Fix INFO SENTINEL memory leak Introduced in #6891 * remove the copy-paste sentence --- src/sentinel.c | 3 +-- tests/sentinel/tests/13-info-command.tcl | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/sentinel.c b/src/sentinel.c index 7e9211bd0..2342c0c00 100644 --- a/src/sentinel.c +++ b/src/sentinel.c @@ -4133,8 +4133,7 @@ void sentinelInfoCommand(client *c) { sections_dict = cached_all_info_sectoins; } - sds info = sdsempty(); - info = genRedisInfoString(sections_dict, 0, 0); + sds info = genRedisInfoString(sections_dict, 0, 0); if (sec_all || (dictFind(sections_dict, "sentinel") != NULL)) { dictIterator *di; dictEntry *de; diff --git a/tests/sentinel/tests/13-info-command.tcl b/tests/sentinel/tests/13-info-command.tcl index 4772a1da8..ef9dc0113 100644 --- a/tests/sentinel/tests/13-info-command.tcl +++ b/tests/sentinel/tests/13-info-command.tcl @@ -1,4 +1,3 @@ -# Check the basic monitoring and failover capabilities. source "../tests/includes/init-tests.tcl" test "info command with at most one argument" {