Skip to content

Commit

Permalink
Fix rDiscardShardsAsync()
Browse files Browse the repository at this point in the history
  • Loading branch information
attipaci committed Jan 5, 2025
1 parent 9ec682d commit 8d00cd0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/redisx-cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ static void rDiscardShardsAsync(RedisShard *shards, int n_shards) {

if(!shards) return;


for(i = 0; i < n_shards; i++) {
RedisShard *s = &shards[i];
int m;
Expand All @@ -125,8 +124,11 @@ static void rDiscardShardsAsync(RedisShard *shards, int n_shards) {
redisxDisconnect(r);
redisxDestroy(r);
}
free(shards);

if(s->redis) free(s->redis);
}

free(shards);
}

/**
Expand Down Expand Up @@ -195,10 +197,10 @@ static RedisShard *rClusterDiscoverAsync(Redis *redis, int *n_shards) {
rCopyConfig(&((RedisPrivate *) redis->priv)->config, s->redis[m]);
}
}

redisxDestroyRESP(reply);
}

redisxDestroyRESP(reply);

if(!isConnected) redisxDisconnect(redis);

if(*n_shards < 0) x_trace(fn, NULL, *n_shards);
Expand Down

0 comments on commit 8d00cd0

Please sign in to comment.