Fix Swapdb crash

Former-commit-id: 1155f5ac6345591fb40a3ce77f81e11485a521dd
This commit is contained in:
Daniel Dai 2021-01-27 14:30:10 -05:00 committed by John Sully
parent 247c916f69
commit d69de1c689

View File

@ -1222,7 +1222,7 @@ int dbSwapDatabases(long id1, long id2) {
if (id1 < 0 || id1 >= cserver.dbnum ||
id2 < 0 || id2 >= cserver.dbnum) return C_ERR;
if (id1 == id2) return C_OK;
redisDb aux(g_pserver->db[id1]);
redisDb aux = g_pserver->db[id1];
redisDb *db1 = &g_pserver->db[id1], *db2 = &g_pserver->db[id2];
/* Swap hash tables. Note that we don't swap blocking_keys,