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>
This commit is contained in:
bentotten 2024-07-04 16:55:55 -07:00 committed by GitHub
parent 1680378845
commit f2bbd1ff0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -578,6 +578,7 @@ int clusterLoadConfig(char *filename) {
memcmp(primary->shard_id, n->shard_id, CLUSTER_NAMELEN) != 0) { memcmp(primary->shard_id, n->shard_id, CLUSTER_NAMELEN) != 0) {
/* If the primary has been added to a shard, make sure this /* If the primary has been added to a shard, make sure this
* node has the same persisted shard id as the primary. */ * node has the same persisted shard id as the primary. */
sdsfreesplitres(argv, argc);
goto fmterr; goto fmterr;
} }
n->replicaof = primary; n->replicaof = primary;