diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2016-06-11 18:03:30 +0200 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2016-06-11 18:03:30 +0200 |
commit | 23c6dba981134987247ff607a6b18a68aef338b9 (patch) | |
tree | 531b6ee35ec300f0d6368c3ac9fe3b091d7888c7 /src/exchange-lib/exchange_api_refresh.c | |
parent | 4f4bad310bc3c34029e7c7d51184c3a163882555 (diff) | |
parent | f4b013b3d467f93482a00b208acf3a2874362fe7 (diff) |
Merge branch 'master' of ssh://taler.net/var/git/exchange
Diffstat (limited to 'src/exchange-lib/exchange_api_refresh.c')
-rw-r--r-- | src/exchange-lib/exchange_api_refresh.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/exchange-lib/exchange_api_refresh.c b/src/exchange-lib/exchange_api_refresh.c index 98c6c086..9a9c6b7e 100644 --- a/src/exchange-lib/exchange_api_refresh.c +++ b/src/exchange-lib/exchange_api_refresh.c @@ -1563,14 +1563,14 @@ refresh_reveal_ok (struct TALER_EXCHANGE_RefreshRevealHandle *rrh, { unsigned int i; json_t *jsona; - struct GNUNET_JSON_Specification spec[] = { + struct GNUNET_JSON_Specification outer_spec[] = { GNUNET_JSON_spec_json ("ev_sigs", &jsona), GNUNET_JSON_spec_end() }; if (GNUNET_OK != GNUNET_JSON_parse (json, - spec, + outer_spec, NULL, NULL)) { GNUNET_break_op (0); @@ -1580,12 +1580,14 @@ refresh_reveal_ok (struct TALER_EXCHANGE_RefreshRevealHandle *rrh, { /* We expected an array of coins */ GNUNET_break_op (0); + GNUNET_JSON_parse_free (outer_spec); return GNUNET_SYSERR; } if (rrh->md->num_fresh_coins != json_array_size (jsona)) { /* Number of coins generated does not match our expectation */ GNUNET_break_op (0); + GNUNET_JSON_parse_free (outer_spec); return GNUNET_SYSERR; } for (i=0;i<rrh->md->num_fresh_coins;i++) @@ -1597,7 +1599,6 @@ refresh_reveal_ok (struct TALER_EXCHANGE_RefreshRevealHandle *rrh, struct GNUNET_CRYPTO_RsaSignature *sig; struct TALER_CoinSpendPublicKeyP coin_pub; struct GNUNET_HashCode coin_hash; - struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_rsa_signature ("ev_sig", &blind_sig), GNUNET_JSON_spec_end() @@ -1614,6 +1615,7 @@ refresh_reveal_ok (struct TALER_EXCHANGE_RefreshRevealHandle *rrh, NULL, NULL)) { GNUNET_break_op (0); + GNUNET_JSON_parse_free (outer_spec); return GNUNET_SYSERR; } @@ -1637,11 +1639,13 @@ refresh_reveal_ok (struct TALER_EXCHANGE_RefreshRevealHandle *rrh, { GNUNET_break_op (0); GNUNET_CRYPTO_rsa_signature_free (sig); + GNUNET_JSON_parse_free (outer_spec); return GNUNET_SYSERR; } coin_privs[i] = fc->coin_priv; sigs[i].rsa_signature = sig; } + GNUNET_JSON_parse_free (outer_spec); return GNUNET_OK; } |