changeset 15938:c0deb3a9bb3d

dsync-server: Don't crash if connection didn't come from doveadm-server
author Timo Sirainen <tss@iki.fi>
date Mon, 25 Feb 2013 17:07:55 +0200
parents c20696d7ecb0
children 2aee41cd72b0
files src/doveadm/dsync/doveadm-dsync.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/doveadm/dsync/doveadm-dsync.c	Mon Feb 25 17:07:38 2013 +0200
+++ b/src/doveadm/dsync/doveadm-dsync.c	Mon Feb 25 17:07:55 2013 +0200
@@ -846,9 +846,11 @@
 		_ctx->exit_code = EX_TEMPFAIL;
 	dsync_ibc_deinit(&ibc);
 
-	/* make sure nothing more is written by the generic doveadm
-	   connection code */
-	o_stream_close(_ctx->conn->output);
+	if (_ctx->conn != NULL) {
+		/* make sure nothing more is written by the generic doveadm
+		   connection code */
+		o_stream_close(_ctx->conn->output);
+	}
 
 	return _ctx->exit_code == 0 ? 0 : -1;
 }