From 3be893123f495efb7239f802549f82bd248033de Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 4 Mar 2013 15:39:43 +0100 Subject: [PATCH] Make sure replicationSetMaster() works when ip argument is not an sds. --- src/replication.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/replication.c b/src/replication.c index 65d960eb9..00ae1d903 100644 --- a/src/replication.c +++ b/src/replication.c @@ -1229,7 +1229,7 @@ int cancelReplicationHandshake(void) { /* Set replication to the specified master address and port. */ void replicationSetMaster(char *ip, int port) { sdsfree(server.masterhost); - server.masterhost = sdsdup(ip); + server.masterhost = sdsnew(ip); server.masterport = port; if (server.master) freeClient(server.master); disconnectSlaves(); /* Force our slaves to resync with us as well. */