From: Aki Tuomi Date: Fri, 10 May 2019 12:55:22 +0000 (+0300) Subject: doveadm-dsync: Always cleanup after connection X-Git-Tag: 2.3.9~505 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d15776d24663feee2863351cda1c5bc1ddc89fc;p=thirdparty%2Fdovecot%2Fcore.git doveadm-dsync: Always cleanup after connection Go through the same error handling path every time. Fixes Panic: file ioloop.c: line 826 (io_loop_destroy): assertion failed: (ioloop == current_ioloop) This happened because the ioloop wasn't destroyed on error. --- diff --git a/src/doveadm/doveadm-dsync.c b/src/doveadm/doveadm-dsync.c index db0d7f522e..720e6a6793 100644 --- a/src/doveadm/doveadm-dsync.c +++ b/src/doveadm/doveadm-dsync.c @@ -857,17 +857,16 @@ dsync_connect_tcp(struct dsync_cmd_context *ctx, "[dsync - connecting to %s]", server->name)); } if (server_connection_create(server, &conn) < 0) { - *error_r = "Couldn't create server connection"; - return -1; - } + ctx->error = "Couldn't create server connection"; + } else { + if (doveadm_verbose_proctitle) { + process_title_set(t_strdup_printf( + "[dsync - running dsync-server on %s]", server->name)); + } - if (doveadm_verbose_proctitle) { - process_title_set(t_strdup_printf( - "[dsync - running dsync-server on %s]", server->name)); + dsync_server_run_command(ctx, conn); } - dsync_server_run_command(ctx, conn); - if (array_count(&server->connections) > 0) server_connection_destroy(&conn);