From f2bbd1ff0f650182e7df1fda1055551389bb79c2 Mon Sep 17 00:00:00 2001 From: bentotten <59932872+bentotten@users.noreply.github.com> Date: Thu, 4 Jul 2024 16:55:55 -0700 Subject: [PATCH] Fix minor memory leak in clusterLoadConfig (#741) We forgot to call sdsfreesplitres in the error path during a nodes.conf corruption check, this function exits on the error paths so this is just a cleanup. Signed-off-by: bentotten <59932872+bentotten@users.noreply.github.com> --- src/cluster_legacy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cluster_legacy.c b/src/cluster_legacy.c index f2f980d58c..61b5af8e29 100644 --- a/src/cluster_legacy.c +++ b/src/cluster_legacy.c @@ -578,6 +578,7 @@ int clusterLoadConfig(char *filename) { memcmp(primary->shard_id, n->shard_id, CLUSTER_NAMELEN) != 0) { /* If the primary has been added to a shard, make sure this * node has the same persisted shard id as the primary. */ + sdsfreesplitres(argv, argc); goto fmterr; } n->replicaof = primary;