merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 0e34ecc097aca775ae7eabfcef48891100783c3a
parent a22465c7c6f50ca328491571b9c053bfcf6e89f3
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sat, 25 Oct 2025 21:23:57 +0200

fix leak (#10505)

Diffstat:
Msrc/backend/taler-merchant-httpd_post-orders-ID-pay.c | 16++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c @@ -3871,20 +3871,18 @@ append_output_token_sig (void *cls, struct GNUNET_CRYPTO_BlindedSignature *sig) { struct PayContext *pc = cls; - struct SignedOutputToken out; struct TALER_MERCHANT_ContractChoice *choice; const struct TALER_MERCHANT_ContractOutput *output; + struct SignedOutputToken out; unsigned int cnt; GNUNET_assert (TALER_MERCHANT_CONTRACT_VERSION_1 == pc->check_contract.contract_terms->version); - choice = &pc->check_contract.contract_terms->details.v1 .choices[pc->parse_wallet_data.choice_index]; output = &choice->outputs[pc->output_index_gen]; cnt = count_output_tokens (pc, output); - out.output_index = pc->output_index_gen; out.h_issue.hash = *h_issue; out.sig.signature = sig; @@ -3892,8 +3890,6 @@ append_output_token_sig (void *cls, GNUNET_array_append (pc->output_tokens, pc->output_tokens_len, out); - - /* Go to next output once we've output all tokens for the current one. */ pc->output_token_cnt++; if (pc->output_token_cnt >= cnt) @@ -4524,6 +4520,8 @@ phase_parse_wallet_data (struct PayContext *pc) bkp_obj)) { GNUNET_break_op (0); + for (size_t j = 0; i < j; j++) + GNUNET_CRYPTO_blinded_message_decref (bkps[j]->blinded_message); GNUNET_free (bkps); resume_pay_with_error (pc, TALER_EC_GENERIC_PARAMETER_MALFORMED, @@ -4913,9 +4911,11 @@ pay_context_cleanup (void *cls) #ifdef HAVE_DONAU_DONAU_SERVICE_H if (NULL != pc->parse_wallet_data.bkps) { - GNUNET_free (pc->parse_wallet_data.bkps); - pc->parse_wallet_data.bkps = NULL; - pc->parse_wallet_data.num_bkps = 0; + for (size_t i = 0; i < pc->parse_wallet_data.num_bkps; i++) + GNUNET_CRYPTO_blinded_message_decref (bkps[i]->blinded_message); + GNUNET_array_grow (pc->parse_wallet_data.bkps, + pc->parse_wallet_data.num_bkps, + 0); } if (NULL != pc->parse_wallet_data.donau_keys) {