MCPcopy Create free account
hub / github.com/F-Stack/f-stack / freeClusterNode

Function freeClusterNode

app/redis-6.2.6/src/redis-benchmark.c:1079–1098  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1077}
1078
1079static void freeClusterNode(clusterNode *node) {
1080 int i;
1081 if (node->name) sdsfree(node->name);
1082 if (node->replicate) sdsfree(node->replicate);
1083 if (node->migrating != NULL) {
1084 for (i = 0; i < node->migrating_count; i++) sdsfree(node->migrating[i]);
1085 zfree(node->migrating);
1086 }
1087 if (node->importing != NULL) {
1088 for (i = 0; i < node->importing_count; i++) sdsfree(node->importing[i]);
1089 zfree(node->importing);
1090 }
1091 /* If the node is not the reference node, that uses the address from
1092 * config.hostip and config.hostport, then the node ip has been
1093 * allocated by fetchClusterConfiguration, so it must be freed. */
1094 if (node->ip && strcmp(node->ip, config.hostip) != 0) sdsfree(node->ip);
1095 if (node->redis_config != NULL) freeRedisConfig(node->redis_config);
1096 zfree(node->slots);
1097 zfree(node);
1098}
1099
1100static void freeClusterNodes() {
1101 int i = 0;

Callers 1

freeClusterNodesFunction · 0.70

Calls 4

sdsfreeFunction · 0.85
strcmpFunction · 0.85
freeRedisConfigFunction · 0.85
zfreeFunction · 0.70

Tested by

no test coverage detected