MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / freeClusterNode

Function freeClusterNode

src/redis-benchmark.cpp:1094–1113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1092}
1093
1094static void freeClusterNode(clusterNode *node) {
1095 int i;
1096 if (node->name) sdsfree(node->name);
1097 if (node->replicate) sdsfree(node->replicate);
1098 if (node->migrating != NULL) {
1099 for (i = 0; i < node->migrating_count; i++) sdsfree(node->migrating[i]);
1100 zfree(node->migrating);
1101 }
1102 if (node->importing != NULL) {
1103 for (i = 0; i < node->importing_count; i++) sdsfree(node->importing[i]);
1104 zfree(node->importing);
1105 }
1106 /* If the node is not the reference node, that uses the address from
1107 * config.hostip and config.hostport, then the node ip has been
1108 * allocated by fetchClusterConfiguration, so it must be freed. */
1109 if (node->ip && strcmp(node->ip, config.hostip) != 0) sdsfree(node->ip);
1110 if (node->redis_config != NULL) freeRedisConfig(node->redis_config);
1111 zfree(node->slots);
1112 zfree(node);
1113}
1114
1115static void freeClusterNodes() {
1116 int i = 0;

Callers 1

freeClusterNodesFunction · 0.70

Calls 3

sdsfreeFunction · 0.85
zfreeFunction · 0.85
freeRedisConfigFunction · 0.85

Tested by

no test coverage detected