diff options
| author | Christian Grothoff <christian@grothoff.org> | 2019-02-17 00:18:04 +0100 | 
|---|---|---|
| committer | Christian Grothoff <christian@grothoff.org> | 2019-02-17 00:18:04 +0100 | 
| commit | 70e7bc1184ca3717dc5cbe1ce0b18ea6a6500108 (patch) | |
| tree | 11265797c02655231730e6f2aea4f34fd989da12 /src | |
| parent | 3ff5bad33e2abf67fa1fb015304c3c6bbd88a82b (diff) | |
fix memory leak if traits are requested multiple times per withdraw
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/testing_api_cmd_withdraw.c | 9 | 
1 files changed, 4 insertions, 5 deletions
| diff --git a/src/lib/testing_api_cmd_withdraw.c b/src/lib/testing_api_cmd_withdraw.c index 7224f65e..41cd2224 100644 --- a/src/lib/testing_api_cmd_withdraw.c +++ b/src/lib/testing_api_cmd_withdraw.c @@ -262,7 +262,7 @@ withdraw_run (void *cls,    }    TALER_planchet_setup_random (&ws->ps);    ws->is = is; -   +    ws->pk = TALER_TESTING_find_pk      (TALER_EXCHANGE_get_keys (is->exchange),       &ws->amount); @@ -365,9 +365,9 @@ withdraw_traits (void *cls,      TALER_TESTING_interpreter_fail (ws->is);      return GNUNET_SYSERR;    } - -  ws->exchange_url = GNUNET_strdup -    (TALER_EXCHANGE_get_base_url (ws->is->exchange)); +  if (NULL == ws->exchange_url) +    ws->exchange_url +      = GNUNET_strdup (TALER_EXCHANGE_get_base_url (ws->is->exchange));    struct TALER_TESTING_Trait traits[] = {      TALER_TESTING_make_trait_coin_priv (0 /* only one coin */, @@ -383,7 +383,6 @@ withdraw_traits (void *cls,      TALER_TESTING_make_trait_amount_obj (0,                                           &ws->amount),      TALER_TESTING_make_trait_url (0, ws->exchange_url), -      TALER_TESTING_trait_end ()    }; | 
