From e5b5099eef2f071acd588684ea647b0a830dc8f8 Mon Sep 17 00:00:00 2001 From: christianEQ Date: Fri, 26 Nov 2021 20:36:46 +0000 Subject: [PATCH] don't save master if host is null Former-commit-id: 8238d8da82c483c093f5248b9dac983bc542e20f --- src/replication.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/replication.cpp b/src/replication.cpp index e1f34f2be..87f3be643 100644 --- a/src/replication.cpp +++ b/src/replication.cpp @@ -2126,6 +2126,10 @@ void saveMasterStatusToStorage() listRewind(g_pserver->masters,&li); while((ln = listNext(&li)) != NULL) { mi = (redisMaster*)listNodeValue(ln); + if (mi->masterhost == NULL) { + // if we don't know the host, no reason to save + continue; + } if (!mi->master) { // If master client is not available, use info from master struct - better than nothing if (mi->master_replid[0] == 0) {