From: Timo Sirainen Date: Tue, 6 Aug 2013 09:48:15 +0000 (+0300) Subject: replicator: Fixed assert-crash if dsync server disconnected. X-Git-Tag: 2.2.6~162 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e7d75716b5ece1ac741f3717d4eb2359723e4e24;p=thirdparty%2Fdovecot%2Fcore.git replicator: Fixed assert-crash if dsync server disconnected. --- 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)