Fix crash in save of masterinfo
This commit is contained in:
parent
39974223eb
commit
4141746f8f
@ -1222,6 +1222,8 @@ int rdbSaveInfoAuxFields(rio *rdb, int rdbflags, rdbSaveInfo *rsi) {
|
||||
sdsstring val = sdsstring(sdsempty());
|
||||
|
||||
for (auto &msi : rsi->vecmastersaveinfo) {
|
||||
if (msi.masterhost == nullptr)
|
||||
continue;
|
||||
val = val.catfmt("%s:%I:%s:%i:%i;", msi.master_replid,
|
||||
msi.master_initial_offset,
|
||||
msi.masterhost.get(),
|
||||
|
@ -1904,6 +1904,7 @@ struct MasterSaveInfo {
|
||||
selected_db = 0;
|
||||
}
|
||||
masterport = mi.masterport;
|
||||
if (mi.masterhost)
|
||||
masterhost = sdsstring(sdsdup(mi.masterhost));
|
||||
masterport = mi.masterport;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user