mirror of
https://github.com/fluencelabs/redis
synced 2025-03-18 16:40:50 +00:00
Merge pull request #5191 from shenlongxing/fix-memory-leak
Fix cluster-announce-ip memory leak
This commit is contained in:
commit
093adb7ef9
@ -3325,10 +3325,11 @@ void clusterCron(void) {
|
||||
if (prev_ip && curr_ip && strcmp(prev_ip,curr_ip)) changed = 1;
|
||||
|
||||
if (changed) {
|
||||
prev_ip = curr_ip;
|
||||
if (prev_ip) prev_ip = zstrdup(prev_ip);
|
||||
if (prev_ip) zfree(prev_ip);
|
||||
|
||||
prev_ip = curr_ip;
|
||||
if (curr_ip) {
|
||||
prev_ip = zstrdup(prev_ip);
|
||||
strncpy(myself->ip,server.cluster_announce_ip,NET_IP_STR_LEN);
|
||||
myself->ip[NET_IP_STR_LEN-1] = '\0';
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user