Skip to content

Commit

Permalink
fix the usee of stack allocated version of dictIterator.
Browse files Browse the repository at this point in the history
Signed-off-by: Roshan Khatri <[email protected]>
  • Loading branch information
roshkhatri committed May 10, 2024
1 parent 8a308c0 commit a0415c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cluster_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -6940,12 +6940,12 @@ void clusterPromoteSelfToMaster(void) {
}

void updateAllCachedNodesHealth(void) {
dictIterator *di = zmalloc(sizeof(*di));
dictIterator di;
dictInitSafeIterator(&di, server.cluster->nodes);
dictEntry *de;
clusterNode *node;
int overall_health_changed = 0;
dictInitSafeIterator(di, server.cluster->nodes);
while((de = dictNext(di)) != NULL) {
while((de = dictNext(&di)) != NULL) {
node = dictGetVal(de);
int present_is_node_healthy = isNodeAvailable(node);
if (present_is_node_healthy != node->is_node_healthy) {
Expand Down

0 comments on commit a0415c8

Please sign in to comment.