Skip to content

Commit

Permalink
Fix minor memory leak in clusterLoadConfig (valkey-io#741)
Browse files Browse the repository at this point in the history
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>
bentotten authored Jul 4, 2024
1 parent 1680378 commit f2bbd1f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/cluster_legacy.c
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit f2bbd1f

Please sign in to comment.