dovecot-2.2: dsync: Fixed crashes with dsync-server -U parameter

dovecot at dovecot.org dovecot at dovecot.org
Mon Apr 8 01:56:37 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/f55fbfc909d1
changeset: 16240:f55fbfc909d1
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Apr 08 01:56:25 2013 +0300
description:
dsync: Fixed crashes with dsync-server -U parameter

diffstat:

 src/doveadm/dsync/doveadm-dsync.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (38 lines):

diff -r 57960f02d1bb -r f55fbfc909d1 src/doveadm/dsync/doveadm-dsync.c
--- a/src/doveadm/dsync/doveadm-dsync.c	Mon Apr 08 00:18:56 2013 +0300
+++ b/src/doveadm/dsync/doveadm-dsync.c	Mon Apr 08 01:56:25 2013 +0300
@@ -909,7 +909,7 @@
 	struct dsync_cmd_context *ctx = (struct dsync_cmd_context *)_ctx;
 	struct dsync_ibc *ibc;
 	struct dsync_brain *brain;
-	string_t *temp_prefix;
+	string_t *temp_prefix, *state_str = NULL;
 
 	if (_ctx->conn != NULL) {
 		/* doveadm-server connection. start with a success reply.
@@ -933,6 +933,11 @@
 
 	io_loop_run(current_ioloop);
 
+	if (ctx->replicator_notify) {
+		state_str = t_str_new(128);
+		dsync_brain_get_state(brain, state_str);
+	}
+
 	if (dsync_brain_deinit(&brain) < 0)
 		_ctx->exit_code = EX_TEMPFAIL;
 	dsync_ibc_deinit(&ibc);
@@ -943,12 +948,8 @@
 		o_stream_close(_ctx->conn->output);
 	}
 
-	if (ctx->replicator_notify) {
-		string_t *state_str = t_str_new(128);
-		dsync_brain_get_state(brain, state_str);
+	if (ctx->replicator_notify)
 		dsync_replicator_notify(ctx, str_c(state_str));
-	}
-
 	return _ctx->exit_code == 0 ? 0 : -1;
 }
 


More information about the dovecot-cvs mailing list