From 9187b765f6cf23a24b3dbb16f069f40dba8a40e9 Mon Sep 17 00:00:00 2001 From: bentotten <59932872+bentotten@users.noreply.github.com> Date: Wed, 3 Jul 2024 10:02:05 -0700 Subject: [PATCH] Fix minor memory leak in clusterLoadConfig We forgot to call sdsfreesplitres in the error path during a nodes.conf corruption check; this function exits on the error paths. 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 dd95cc6bb7..ef9805570b 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;