mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 08:38:27 -05:00
Cluster Manager: fix memory leaks in clusterManagerGetDisconnectedLinks
This commit is contained in:
parent
b013d2c4db
commit
121adc604b
@ -3889,7 +3889,7 @@ static list *clusterManagerGetDisconnectedLinks(clusterManagerNode *node) {
|
|||||||
(strstr(link_status, "disconnected")));
|
(strstr(link_status, "disconnected")));
|
||||||
int handshaking = (strstr(flags, "handshake") != NULL);
|
int handshaking = (strstr(flags, "handshake") != NULL);
|
||||||
if (disconnected || handshaking) {
|
if (disconnected || handshaking) {
|
||||||
clusterManagerLink *link = malloc(sizeof(*link));
|
clusterManagerLink *link = zmalloc(sizeof(*link));
|
||||||
link->node_name = sdsnew(nodename);
|
link->node_name = sdsnew(nodename);
|
||||||
link->node_addr = sdsnew(addr);
|
link->node_addr = sdsnew(addr);
|
||||||
link->connected = 0;
|
link->connected = 0;
|
||||||
@ -3908,6 +3908,7 @@ cleanup:
|
|||||||
static dict *clusterManagerGetLinkStatus(void) {
|
static dict *clusterManagerGetLinkStatus(void) {
|
||||||
if (cluster_manager.nodes == NULL) return NULL;
|
if (cluster_manager.nodes == NULL) return NULL;
|
||||||
dictType dtype = clusterManagerDictType;
|
dictType dtype = clusterManagerDictType;
|
||||||
|
dtype.keyDestructor = dictSdsDestructor;
|
||||||
dtype.valDestructor = dictListDestructor;
|
dtype.valDestructor = dictListDestructor;
|
||||||
dict *status = dictCreate(&dtype, NULL);
|
dict *status = dictCreate(&dtype, NULL);
|
||||||
listIter li;
|
listIter li;
|
||||||
|
Loading…
Reference in New Issue
Block a user