From e46467510daf1dc55b9d01fcca42eb9912492133 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 19 Jan 2020 22:23:57 +0100 Subject: leak fixes --- src/testing/testing_api_cmd_withdraw.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/testing') diff --git a/src/testing/testing_api_cmd_withdraw.c b/src/testing/testing_api_cmd_withdraw.c index b62420557..207d11876 100644 --- a/src/testing/testing_api_cmd_withdraw.c +++ b/src/testing/testing_api_cmd_withdraw.c @@ -263,23 +263,23 @@ withdraw_run (void *cls, } TALER_planchet_setup_random (&ws->ps); ws->is = is; - - dpk = TALER_TESTING_find_pk (TALER_EXCHANGE_get_keys (is->exchange), - &ws->amount); - if (NULL == dpk) - { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Failed to determine denomination key at %s\n", - (NULL != cmd) ? cmd->label : ""); - GNUNET_assert (0); - } - else + if (NULL == ws->pk) { + dpk = TALER_TESTING_find_pk (TALER_EXCHANGE_get_keys (is->exchange), + &ws->amount); + if (NULL == dpk) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Failed to determine denomination key at %s\n", + (NULL != cmd) ? cmd->label : ""); + GNUNET_break (0); + TALER_TESTING_interpreter_fail (is); + return; + } /* We copy the denomination key, as re-querying /keys * would free the old one. */ ws->pk = TALER_EXCHANGE_copy_denomination_key (dpk); } - ws->wsh = TALER_EXCHANGE_reserve_withdraw (is->exchange, ws->pk, rp, -- cgit v1.2.3