]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
pgsql: Fixed clearing sql_commit_result.error_type
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 9 Sep 2016 14:46:51 +0000 (17:46 +0300)
committerGitLab <gitlab@git.dovecot.net>
Tue, 13 Sep 2016 14:51:25 +0000 (17:51 +0300)
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.

src/lib-sql/driver-pgsql.c

index ce95b8152e738b37dd5ff40530a13ef8db7f51e7..fbfa684aa26896cabe9b759548c73eee19086c53 100644 (file)
@@ -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);
 }