From e7d75716b5ece1ac741f3717d4eb2359723e4e24 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 6 Aug 2013 12:48:15 +0300 Subject: [PATCH] replicator: Fixed assert-crash if dsync server disconnected. --- src/replication/replicator/dsync-client.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/replication/replicator/dsync-client.c b/src/replication/replicator/dsync-client.c index 7fdddd2e7d..75f2e96f9d 100644 --- a/src/replication/replicator/dsync-client.c +++ b/src/replication/replicator/dsync-client.c @@ -68,6 +68,10 @@ static void dsync_callback(struct dsync_client *client, static void dsync_close(struct dsync_client *client) { + client->cmd_sent = FALSE; + client->handshaked = FALSE; + i_free_and_null(client->state); + if (client->fd == -1) return; @@ -77,9 +81,6 @@ static void dsync_close(struct dsync_client *client) if (close(client->fd) < 0) i_error("close(dsync) failed: %m"); client->fd = -1; - i_free_and_null(client->state); - client->cmd_sent = FALSE; - client->handshaked = FALSE; } static void dsync_disconnect(struct dsync_client *client) -- 2.47.3