dovecot-2.2: pgsql: Avoid crash in multi-command transaction if ...

dovecot at dovecot.org dovecot at dovecot.org
Thu Sep 24 13:42:36 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/68dd32223db7
changeset: 19211:68dd32223db7
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Sep 24 16:41:10 2015 +0300
description:
pgsql: Avoid crash in multi-command transaction if one of the queries couldn't be sent to server.

diffstat:

 src/lib-sql/driver-pgsql.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (17 lines):

diff -r e94781b25c83 -r 68dd32223db7 src/lib-sql/driver-pgsql.c
--- a/src/lib-sql/driver-pgsql.c	Thu Sep 24 16:30:23 2015 +0300
+++ b/src/lib-sql/driver-pgsql.c	Thu Sep 24 16:41:10 2015 +0300
@@ -895,9 +895,11 @@
 	}
 
 	if (ctx->ctx.head != NULL) {
-		sql_query(ctx->ctx.db, ctx->ctx.head->query,
-			  transaction_update_callback, ctx->ctx.head);
+		struct sql_transaction_query *query = ctx->ctx.head;
+
 		ctx->ctx.head = ctx->ctx.head->next;
+		sql_query(ctx->ctx.db, query->query,
+			  transaction_update_callback, query);
 	} else {
 		sql_query(ctx->ctx.db, "COMMIT",
 			  transaction_commit_callback, ctx);


More information about the dovecot-cvs mailing list