From 58ef2569a75504f9f27f7228e24b2e105766a744 Mon Sep 17 00:00:00 2001 From: git-hulk Date: Wed, 8 May 2019 16:35:48 +0800 Subject: [PATCH] FIX: memory leak when failed to connect the server --- src/cluster.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cluster.c b/src/cluster.c index e1d67bd..1f50fb0 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -279,6 +279,7 @@ int fetchClusterConfiguration(redisCluster *cluster, char *ip, int port, if (hostsocket == NULL) fprintf(stderr,"%s:%d: %s\n", ip, port, ctx->errstr); else fprintf(stderr,"%s: %s\n", hostsocket, ctx->errstr); + redisFree(ctx); return 0; } clusterNode *firstNode = createClusterNode(ip, port, cluster);