summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2016-06-11 18:03:30 +0200
committerMarcello Stanisci <marcello.stanisci@inria.fr>2016-06-11 18:03:30 +0200
commit23c6dba981134987247ff607a6b18a68aef338b9 (patch)
tree531b6ee35ec300f0d6368c3ac9fe3b091d7888c7 /src
parent4f4bad310bc3c34029e7c7d51184c3a163882555 (diff)
parentf4b013b3d467f93482a00b208acf3a2874362fe7 (diff)
downloadexchange-23c6dba981134987247ff607a6b18a68aef338b9.tar.gz
exchange-23c6dba981134987247ff607a6b18a68aef338b9.tar.bz2
exchange-23c6dba981134987247ff607a6b18a68aef338b9.zip
Merge branch 'master' of ssh://taler.net/var/git/exchange
Diffstat (limited to 'src')
-rw-r--r--src/bank-lib/fakebank.c9
-rw-r--r--src/exchange-lib/exchange_api_refresh.c10
-rw-r--r--src/exchange-lib/exchange_api_reserve.c6
-rw-r--r--src/exchange-lib/exchange_api_track_transfer.c4
-rw-r--r--src/exchange-lib/test_exchange_api.c1
-rw-r--r--src/exchange-tools/taler-exchange-keyup.c2
-rw-r--r--src/exchange/taler-exchange-aggregator.c5
-rw-r--r--src/util/util.c4
8 files changed, 35 insertions, 6 deletions
diff --git a/src/bank-lib/fakebank.c b/src/bank-lib/fakebank.c
index 13bfa1cb5..c4934fd27 100644
--- a/src/bank-lib/fakebank.c
+++ b/src/bank-lib/fakebank.c
@@ -192,6 +192,15 @@ TALER_FAKEBANK_check_empty (struct TALER_FAKEBANK_Handle *h)
void
TALER_FAKEBANK_stop (struct TALER_FAKEBANK_Handle *h)
{
+ struct Transaction *t;
+
+ while (NULL != (t = h->transactions_head))
+ {
+ GNUNET_CONTAINER_DLL_remove (h->transactions_head,
+ h->transactions_tail,
+ t);
+ GNUNET_free (t);
+ }
if (NULL != h->mhd_task)
{
GNUNET_SCHEDULER_cancel (h->mhd_task);
diff --git a/src/exchange-lib/exchange_api_refresh.c b/src/exchange-lib/exchange_api_refresh.c
index 98c6c086b..9a9c6b7eb 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;
}
diff --git a/src/exchange-lib/exchange_api_reserve.c b/src/exchange-lib/exchange_api_reserve.c
index 2b07223af..926157a86 100644
--- a/src/exchange-lib/exchange_api_reserve.c
+++ b/src/exchange-lib/exchange_api_reserve.c
@@ -115,7 +115,7 @@ parse_reserve_history (const json_t *history,
struct GNUNET_JSON_Specification hist_spec[] = {
GNUNET_JSON_spec_string ("type", &type),
TALER_JSON_spec_amount ("amount",
- &amount),
+ &amount),
/* 'wire' and 'signature' are optional depending on 'type'! */
GNUNET_JSON_spec_end()
};
@@ -185,9 +185,9 @@ parse_reserve_history (const json_t *history,
struct TALER_Amount amount_from_purpose;
struct GNUNET_JSON_Specification withdraw_spec[] = {
GNUNET_JSON_spec_fixed_auto ("signature",
- &sig),
+ &sig),
GNUNET_JSON_spec_fixed_auto ("details",
- &withdraw_purpose),
+ &withdraw_purpose),
GNUNET_JSON_spec_end()
};
unsigned int i;
diff --git a/src/exchange-lib/exchange_api_track_transfer.c b/src/exchange-lib/exchange_api_track_transfer.c
index 417d065f0..4cfd07361 100644
--- a/src/exchange-lib/exchange_api_track_transfer.c
+++ b/src/exchange-lib/exchange_api_track_transfer.c
@@ -138,6 +138,7 @@ check_track_transfer_response_ok (struct TALER_EXCHANGE_TrackTransferHandle *wdh
{
GNUNET_break_op (0);
GNUNET_CRYPTO_hash_context_abort (hash_context);
+ GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
/* build up big hash for signature checking later */
@@ -166,6 +167,7 @@ check_track_transfer_response_ok (struct TALER_EXCHANGE_TrackTransferHandle *wdh
&exchange_pub))
{
GNUNET_break_op (0);
+ GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
if (GNUNET_OK !=
@@ -173,6 +175,7 @@ check_track_transfer_response_ok (struct TALER_EXCHANGE_TrackTransferHandle *wdh
&exchange_pub))
{
GNUNET_break_op (0);
+ GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
wdh->cb (wdh->cb_cls,
@@ -184,6 +187,7 @@ check_track_transfer_response_ok (struct TALER_EXCHANGE_TrackTransferHandle *wdh
num_details,
details);
}
+ GNUNET_JSON_parse_free (spec);
TALER_EXCHANGE_track_transfer_cancel (wdh);
return GNUNET_OK;
}
diff --git a/src/exchange-lib/test_exchange_api.c b/src/exchange-lib/test_exchange_api.c
index acd087039..337fd297b 100644
--- a/src/exchange-lib/test_exchange_api.c
+++ b/src/exchange-lib/test_exchange_api.c
@@ -1915,6 +1915,7 @@ interpreter_run (void *cls)
}
TALER_JSON_hash (contract,
&h_contract);
+ json_decref (contract);
wire = json_loads (cmd->details.deposit.wire_details,
JSON_REJECT_DUPLICATES,
NULL);
diff --git a/src/exchange-tools/taler-exchange-keyup.c b/src/exchange-tools/taler-exchange-keyup.c
index 4f8a604ea..69d28361f 100644
--- a/src/exchange-tools/taler-exchange-keyup.c
+++ b/src/exchange-tools/taler-exchange-keyup.c
@@ -523,6 +523,7 @@ exchange_keys_update_signkeys ()
{
fprintf (stderr,
"Failed to create signing key directory\n");
+ GNUNET_free (signkey_dir);
return GNUNET_SYSERR;
}
@@ -530,6 +531,7 @@ exchange_keys_update_signkeys ()
signkey_duration,
GNUNET_TIME_UNIT_ZERO /* no overlap for signing keys */,
&anchor);
+ GNUNET_free (signkey_dir);
while (anchor.abs_value_us < lookahead_sign_stamp.abs_value_us)
{
diff --git a/src/exchange/taler-exchange-aggregator.c b/src/exchange/taler-exchange-aggregator.c
index 08ea8abe9..e3262962c 100644
--- a/src/exchange/taler-exchange-aggregator.c
+++ b/src/exchange/taler-exchange-aggregator.c
@@ -757,6 +757,7 @@ run_aggregation (void *cls)
"Preparing wire transfer of %s to %s\n",
amount_s,
TALER_B2S (&au->merchant_pub));
+ GNUNET_free (amount_s);
}
au->wp = wp;
au->ph = wp->wire_plugin->prepare_wire_transfer (wp->wire_plugin->cls,
@@ -1095,7 +1096,11 @@ main (int argc,
gettext_noop ("background process that aggregates and executes wire transfers to merchants"),
options,
&run, NULL))
+ {
+ GNUNET_free ((void*) argv);
return 1;
+ }
+ GNUNET_free ((void*) argv);
return global_ret;
}
diff --git a/src/util/util.c b/src/util/util.c
index 9defa85ff..1f7931a43 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -84,7 +84,11 @@ TALER_config_get_denom (const struct GNUNET_CONFIGURATION_Handle *cfg,
return GNUNET_NO;
if (GNUNET_OK != TALER_string_to_amount (str,
denom))
+ {
+ GNUNET_free (str);
return GNUNET_SYSERR;
+ }
+ GNUNET_free (str);
return GNUNET_OK;
}