From: Timo Sirainen Date: Fri, 9 Sep 2016 14:46:51 +0000 (+0300) Subject: pgsql: Fixed clearing sql_commit_result.error_type X-Git-Tag: 2.3.0.rc1~3039 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e87393d3a562cdbc3fd0b346d57612808175f420;p=thirdparty%2Fdovecot%2Fcore.git pgsql: Fixed clearing sql_commit_result.error_type error was correctly set to NULL with the earlier memset(), but error_type may have been garbage. This shouldn't have caused any actual problems. --- diff --git a/src/lib-sql/driver-pgsql.c b/src/lib-sql/driver-pgsql.c index ce95b8152e..fbfa684aa2 100644 --- a/src/lib-sql/driver-pgsql.c +++ b/src/lib-sql/driver-pgsql.c @@ -875,7 +875,7 @@ transaction_commit_callback(struct sql_result *result, { struct sql_commit_result commit_result; - memset(&commit_result, 0, sizeof(result)); + memset(&commit_result, 0, sizeof(commit_result)); if (sql_result_next_row(result) < 0) { commit_result.error = sql_result_get_error(result); commit_result.error_type = sql_result_get_error_type(result); @@ -920,7 +920,7 @@ transaction_commit_error_callback(struct pgsql_transaction_context *ctx, { struct sql_commit_result commit_result; - memset(&commit_result, 0, sizeof(result)); + memset(&commit_result, 0, sizeof(commit_result)); commit_result.error = sql_result_get_error(result); commit_result.error_type = sql_result_get_error_type(result); @@ -992,7 +992,7 @@ transaction_trans_query_callback(struct sql_result *result, query->affected_rows) < 0) i_unreached(); } - memset(&commit_result, 0, sizeof(result)); + memset(&commit_result, 0, sizeof(commit_result)); ctx->callback(&commit_result, ctx->context); driver_pgsql_transaction_free(ctx); }