exchange

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

commit a90ee41a414c8e2c9e550ab325f1db5906c81f41
parent bbe66ad4cf81749cba522d72e0490751a05d97dd
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri,  9 May 2025 20:38:23 +0200

more leak fixes

Diffstat:
Msrc/exchange/taler-exchange-httpd_common_kyc.c | 12++++++++++++
Msrc/exchange/taler-exchange-httpd_db.c | 3++-
Msrc/exchange/taler-exchange-httpd_kyc-info.c | 5++++-
Msrc/exchange/taler-exchange-httpd_reveal-withdraw.c | 5++++-
Msrc/kyclogic/kyclogic_api.c | 6++++--
5 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_common_kyc.c b/src/exchange/taler-exchange-httpd_common_kyc.c @@ -1667,9 +1667,19 @@ legitimization_check_run ( } } + /* NOTE-CG: I don't recall why we need to make this distinction + and re-fetch the rules this way. The main difference is that + we fetch the "legitimization_outcome_last_row" on the true + path, but we could presumably fetch it above as well. Not + doing another transaction would seem more efficient. So why + exactly do we do this here? */ if (NULL != lrs) { + /* Stop the current transaction and start a new + asynchronous task with a new transaction to + fetch the rules for the account. */ TEH_plugin->rollback (TEH_plugin->cls); + TALER_KYCLOGIC_rules_free (lrs); lch->ru = TALER_EXCHANGEDB_update_rules (TEH_plugin, &TEH_attribute_key, &lch->h_payto, @@ -1681,6 +1691,8 @@ legitimization_check_run ( { struct TALER_EXCHANGEDB_RuleUpdaterResult rur = { 0 }; + /* Simplified case, just default rules apply, we can + continue in this transaction */ current_rules_cb (lch, &rur); } diff --git a/src/exchange/taler-exchange-httpd_db.c b/src/exchange/taler-exchange-httpd_db.c @@ -95,7 +95,8 @@ TEH_make_coin_known (const struct TALER_CoinPublicInfo *coin, &coin->coin_pub, &prev_denom.pub, &prev_denom.sig); - + TALER_denom_pub_free (&prev_denom.pub); + TALER_denom_sig_free (&prev_denom.sig); return GNUNET_DB_STATUS_HARD_ERROR; } case TALER_EXCHANGEDB_CKS_AGE_CONFLICT_EXPECTED_NULL: diff --git a/src/exchange/taler-exchange-httpd_kyc-info.c b/src/exchange/taler-exchange-httpd_kyc-info.c @@ -509,6 +509,7 @@ current_rules_cb ( enum GNUNET_DB_QueryStatus qs; uint64_t legitimization_measure_last_row; json_t *jmeasures; + json_t *vmeasures; kyp->ru = NULL; if (TALER_EC_NONE != rur->ec) @@ -673,11 +674,13 @@ current_rules_cb ( } GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Generating success reply to kyc-info query\n"); + vmeasures = TALER_KYCLOGIC_voluntary_measures (kyp->lrs); resume_with_reply (kyp, legitimization_measure_last_row, kyp->legitimization_outcome_last_row, jmeasures, - TALER_KYCLOGIC_voluntary_measures (kyp->lrs)); + vmeasures); + json_decref (vmeasures); json_decref (jmeasures); } diff --git a/src/exchange/taler-exchange-httpd_reveal-withdraw.c b/src/exchange/taler-exchange-httpd_reveal-withdraw.c @@ -622,9 +622,12 @@ TEH_handler_reveal_withdraw ( GNUNET_JSON_parse_free (spec); if (NULL != actx.withdraw.denom_sigs) + { for (size_t i = 0; i<actx.withdraw.num_coins; i++) TALER_blinded_denom_sig_free (&actx.withdraw.denom_sigs[i]); - GNUNET_free (actx.withdraw.denom_sigs); + GNUNET_free (actx.withdraw.denom_sigs); + } + GNUNET_free (actx.withdraw.cs_r_values); GNUNET_free (actx.withdraw.denom_pub_hashes); GNUNET_free (actx.withdraw.denom_serials); return result; diff --git a/src/kyclogic/kyclogic_api.c b/src/kyclogic/kyclogic_api.c @@ -4575,6 +4575,7 @@ TALER_KYCLOGIC_run_aml_program2 ( aprh->async_cb = GNUNET_SCHEDULER_add_now (&async_return_task, aprh); + json_decref (attributes); return aprh; } } @@ -4611,6 +4612,7 @@ TALER_KYCLOGIC_run_aml_program2 ( aprh->async_cb = GNUNET_SCHEDULER_add_now (&async_return_task, aprh); + json_decref (attributes); return aprh; } } @@ -4658,8 +4660,8 @@ TALER_KYCLOGIC_run_aml_program2 ( GNUNET_JSON_pack_object_incref ("context", (json_t *) context)), GNUNET_JSON_pack_allow_null ( - GNUNET_JSON_pack_object_incref ("attributes", - (json_t *) attributes)), + GNUNET_JSON_pack_object_steal ("attributes", + attributes)), GNUNET_JSON_pack_allow_null ( GNUNET_JSON_pack_array_steal ("aml_history", aml_history)),