Cluster: check link is valid before sending UPDATE.

This commit is contained in:
antirez 2013-12-17 12:28:37 +01:00
parent f57bb36ce7
commit fda91dbde3

View File

@ -1691,6 +1691,7 @@ void clusterSendUpdate(clusterLink *link, clusterNode *node) {
unsigned char buf[sizeof(clusterMsg)];
clusterMsg *hdr = (clusterMsg*) buf;
if (link == NULL) return;
clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_UPDATE);
memcpy(hdr->data.update.nodecfg.nodename,node->name,REDIS_CLUSTER_NAMELEN);
hdr->data.update.nodecfg.configEpoch = htonu64(node->configEpoch);