]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
replicator: Fixed assert-crash if dsync server disconnected.
authorTimo Sirainen <tss@iki.fi>
Tue, 6 Aug 2013 09:48:15 +0000 (12:48 +0300)
committerTimo Sirainen <tss@iki.fi>
Tue, 6 Aug 2013 09:48:15 +0000 (12:48 +0300)
src/replication/replicator/dsync-client.c

index 7fdddd2e7d5ae00063139b3925180b176a5b58e1..75f2e96f9d75e7bb274d8a71642faf5c7112d286 100644 (file)
@@ -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)