diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-02-17 16:57:29 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-02-17 16:57:29 +0100 |
commit | 86e0f2c70d07c7c5e1656667bd818498ea55d0a4 (patch) | |
tree | dba9439c62d1b017319d9e313a82b33ea6c68187 /src/exchange/taler-exchange-httpd_reserves_close.c | |
parent | 87a78c6f8ce1d50a5f61eb5c3f222cdef0b635ee (diff) |
fix memory leak and transaction error handling related to KYC
Diffstat (limited to 'src/exchange/taler-exchange-httpd_reserves_close.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_reserves_close.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/exchange/taler-exchange-httpd_reserves_close.c b/src/exchange/taler-exchange-httpd_reserves_close.c index 29c08ff7..760f705c 100644 --- a/src/exchange/taler-exchange-httpd_reserves_close.c +++ b/src/exchange/taler-exchange-httpd_reserves_close.c @@ -228,7 +228,7 @@ reserve_close_transaction (void *cls, /* KYC check may be needed: we're not returning the money to the account that funded the reserve in the first place. */ - const char *kyc_needed; + char *kyc_needed; TALER_payto_hash (rcc->payto_uri, &rcc->kyc_payto); @@ -268,11 +268,22 @@ reserve_close_transaction (void *cls, if (NULL != kyc_needed) { rcc->kyc.ok = false; - return TEH_plugin->insert_kyc_requirement_for_account ( + qs = TEH_plugin->insert_kyc_requirement_for_account ( TEH_plugin->cls, kyc_needed, &rcc->kyc_payto, &rcc->kyc.requirement_row); + GNUNET_free (kyc_needed); + if (GNUNET_DB_STATUS_HARD_ERROR == qs) + { + GNUNET_break (0); + *mhd_ret + = TALER_MHD_reply_with_error (connection, + MHD_HTTP_INTERNAL_SERVER_ERROR, + TALER_EC_GENERIC_DB_STORE_FAILED, + "insert_kyc_requirement_for_account"); + } + return qs; } } |