changeset 15633:4da6d4fa1892

dsync server: Fixed crash at deinit
author Timo Sirainen <tss@iki.fi>
date Thu, 10 Jan 2013 13:56:59 +0200
parents 40dd9a080b6e
children 68b7c9ce713b
files src/doveadm/dsync/doveadm-dsync.c
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/doveadm/dsync/doveadm-dsync.c	Thu Jan 10 12:12:50 2013 +0200
+++ b/src/doveadm/dsync/doveadm-dsync.c	Thu Jan 10 13:56:59 2013 +0200
@@ -666,12 +666,10 @@
 
 	io_loop_run(current_ioloop);
 
-	dsync_ibc_deinit(&ibc);
-	if (dsync_brain_deinit(&brain) < 0) {
+	if (dsync_brain_deinit(&brain) < 0)
 		_ctx->exit_code = EX_TEMPFAIL;
-		return -1;
-	}
-	return 0;
+	dsync_ibc_deinit(&ibc);
+	return _ctx->exit_code == 0 ? 0 : -1;
 }
 
 static bool