exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 89be551591dfb4e0c523e35967b052279b9190ec
parent 2ace4be7ece935e61627ae19ecef4ad5011cc315
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon, 29 Jun 2026 17:40:16 +0200

bugfixes

Diffstat:
Msrc/bank-lib/bank_api_parse.c | 32+++++++++-----------------------
Msrc/exchangedb/begin_revolving_shard.c | 2+-
Msrc/exchangedb/get_coin_transactions.c | 2++
Msrc/exchangedb/get_global_fees.c | 22+++++++++++++---------
Msrc/exchangedb/get_reserve_history.c | 3+++
Msrc/exchangedb/insert_records_by_table.c | 16+++++++++-------
Msrc/exchangedb/lookup_serial_by_table.c | 2+-
7 files changed, 38 insertions(+), 41 deletions(-)

diff --git a/src/bank-lib/bank_api_parse.c b/src/bank-lib/bank_api_parse.c @@ -64,6 +64,7 @@ TALER_BANK_auth_parse_cfg (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, section, "WIRE_GATEWAY_URL"); + TALER_BANK_auth_free (auth); return GNUNET_SYSERR; } if (GNUNET_OK != @@ -75,7 +76,7 @@ TALER_BANK_auth_parse_cfg (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, section, "WIRE_GATEWAY_AUTH_METHOD"); - GNUNET_free (auth->wire_gateway_url); + TALER_BANK_auth_free (auth); return GNUNET_SYSERR; } for (unsigned int i = 0; NULL != methods[i].m; i++) @@ -101,7 +102,7 @@ TALER_BANK_auth_parse_cfg (const struct GNUNET_CONFIGURATION_Handle *cfg, section, "USERNAME"); GNUNET_free (method); - GNUNET_free (auth->wire_gateway_url); + TALER_BANK_auth_free (auth); return GNUNET_SYSERR; } if (GNUNET_OK != @@ -111,13 +112,11 @@ TALER_BANK_auth_parse_cfg (const struct GNUNET_CONFIGURATION_Handle *cfg, "PASSWORD", &auth->details.basic.password)) { - GNUNET_free (auth->details.basic.username); - auth->details.basic.username = NULL; GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, section, "PASSWORD"); GNUNET_free (method); - GNUNET_free (auth->wire_gateway_url); + TALER_BANK_auth_free (auth); return GNUNET_SYSERR; } auth->method = TALER_BANK_AUTH_BASIC; @@ -135,7 +134,7 @@ TALER_BANK_auth_parse_cfg (const struct GNUNET_CONFIGURATION_Handle *cfg, section, "TOKEN"); GNUNET_free (method); - GNUNET_free (auth->wire_gateway_url); + TALER_BANK_auth_free (auth); return GNUNET_SYSERR; } auth->method = TALER_BANK_AUTH_BEARER; @@ -160,28 +159,15 @@ TALER_BANK_auth_free (struct TALER_BANK_AuthenticationData *auth) case TALER_BANK_AUTH_NONE: break; case TALER_BANK_AUTH_BASIC: - if (NULL != auth->details.basic.username) - { - GNUNET_free (auth->details.basic.username); - auth->details.basic.username = NULL; - } - if (NULL != auth->details.basic.password) - { - GNUNET_free (auth->details.basic.password); - auth->details.basic.password = NULL; - } + GNUNET_free (auth->details.basic.username); + GNUNET_free (auth->details.basic.password); break; case TALER_BANK_AUTH_BEARER: - if (NULL != auth->details.bearer.token) - { - GNUNET_free (auth->details.bearer.token); - auth->details.bearer.token = NULL; - } + GNUNET_free (auth->details.bearer.token); break; } - GNUNET_free (auth->wire_gateway_url); - auth->wire_gateway_url = NULL; + GNUNET_free (auth->core_bank_url); } diff --git a/src/exchangedb/begin_revolving_shard.c b/src/exchangedb/begin_revolving_shard.c @@ -218,7 +218,7 @@ TALER_EXCHANGEDB_begin_revolving_shard ( case GNUNET_DB_STATUS_HARD_ERROR: GNUNET_break (0); TALER_EXCHANGEDB_rollback (pg); - return qs; + return qsz; case GNUNET_DB_STATUS_SOFT_ERROR: TALER_EXCHANGEDB_rollback (pg); continue; diff --git a/src/exchangedb/get_coin_transactions.c b/src/exchangedb/get_coin_transactions.c @@ -1152,6 +1152,8 @@ TALER_EXCHANGEDB_get_coin_transactions ( case GNUNET_DB_STATUS_SOFT_ERROR: if (begin_transaction) TALER_EXCHANGEDB_rollback (pg); + TALER_EXCHANGEDB_free_coin_transaction_list (chc.head); + chc.head = NULL; continue; default: break; diff --git a/src/exchangedb/get_global_fees.c b/src/exchangedb/get_global_fees.c @@ -121,10 +121,10 @@ global_fees_cb (void *cls, enum GNUNET_DB_QueryStatus -TALER_TALER_EXCHANGEDB_get_global_fees (struct - TALER_EXCHANGEDB_PostgresContext *pg, - TALER_EXCHANGEDB_GlobalFeeCallback cb, - void *cb_cls) +TALER_TALER_EXCHANGEDB_get_global_fees ( + struct TALER_EXCHANGEDB_PostgresContext *pg, + TALER_EXCHANGEDB_GlobalFeeCallback cb, + void *cb_cls) { struct GNUNET_TIME_Timestamp date = GNUNET_TIME_absolute_to_timestamp ( @@ -141,6 +141,7 @@ TALER_TALER_EXCHANGEDB_get_global_fees (struct .pg = pg, .status = GNUNET_OK }; + enum GNUNET_DB_QueryStatus qs; PREPARE (pg, "get_global_fees", @@ -156,9 +157,12 @@ TALER_TALER_EXCHANGEDB_get_global_fees (struct ",master_sig" " FROM global_fee" " WHERE start_date >= $1"); - return GNUNET_PQ_eval_prepared_multi_select (pg->conn, - "get_global_fees", - params, - &global_fees_cb, - &gctx); + qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, + "get_global_fees", + params, + &global_fees_cb, + &gctx); + if (GNUNET_OK != gctx.status) + return GNUNET_DB_STATUS_HARD_ERROR; + return qs; } diff --git a/src/exchangedb/get_reserve_history.c b/src/exchangedb/get_reserve_history.c @@ -964,6 +964,9 @@ TALER_EXCHANGEDB_get_reserve_history ( return qs; case GNUNET_DB_STATUS_SOFT_ERROR: TALER_EXCHANGEDB_rollback (pg); + TALER_EXCHANGEDB_free_reserve_history (rhc.rh); + rhc.rh = NULL; + rhc.rh_tail = NULL; continue; default: break; diff --git a/src/exchangedb/insert_records_by_table.c b/src/exchangedb/insert_records_by_table.c @@ -874,6 +874,7 @@ irbt_cb_table_refresh (struct TALER_EXCHANGEDB_PostgresContext *pg, pg->conn), GNUNET_PQ_query_param_end }; + enum GNUNET_DB_QueryStatus qs; PREPARE (pg, "insert_into_table_refresh", @@ -895,9 +896,11 @@ irbt_cb_table_refresh (struct TALER_EXCHANGEDB_PostgresContext *pg, ",denom_sigs" ") VALUES " "($1, $2, $3, $4, $5, $6,$7,$8,$9,$10,$11,$12,$13,$14,$15);"); - return GNUNET_PQ_eval_prepared_non_select (pg->conn, - "insert_into_table_refresh", - params); + qs = GNUNET_PQ_eval_prepared_non_select (pg->conn, + "insert_into_table_refresh", + params); + GNUNET_PQ_cleanup_query_params_closures (params); + return qs; } @@ -2150,10 +2153,9 @@ irbt_cb_table_withdraw ( enum GNUNET_DB_QueryStatus -TALER_EXCHANGEDB_insert_records_by_table (struct - TALER_EXCHANGEDB_PostgresContext *pg, - const struct - TALER_EXCHANGEDB_TableData *td) +TALER_EXCHANGEDB_insert_records_by_table ( + struct TALER_EXCHANGEDB_PostgresContext *pg, + const struct TALER_EXCHANGEDB_TableData *td) { InsertRecordCallback rh = NULL; diff --git a/src/exchangedb/lookup_serial_by_table.c b/src/exchangedb/lookup_serial_by_table.c @@ -104,7 +104,7 @@ TALER_EXCHANGEDB_lookup_serial_by_table (struct "SELECT" " kycauth_in_serial_id AS serial" " FROM kycauths_in" - " ORDER BY kycauths_in_serial_id DESC" + " ORDER BY kycauth_in_serial_id DESC" " LIMIT 1;"); break; case TALER_EXCHANGEDB_RT_RESERVES_CLOSE: