Skip to content

Commit

Permalink
Fix minor memory leak in clusterLoadConfig
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.

Signed-off-by: bentotten <[email protected]>
  • Loading branch information
bentotten authored Jul 3, 2024
1 parent b298dfd commit 9187b76
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
Expand Up @@ -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;
Expand Down

0 comments on commit 9187b76

Please sign in to comment.