summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-01-16 13:11:35 +0100
committerChristian Grothoff <christian@grothoff.org>2018-01-16 13:11:35 +0100
commitbc7957f39338f220ec4a7e1b21e17b6142b809de (patch)
tree071203d8cc6e0f9e5be3fc6e52a643bfa5f5a2d0
parentc300b88af215e6bd8f59dac87cde754f7e4b4cdb (diff)
downloadexchange-bc7957f39338f220ec4a7e1b21e17b6142b809de.tar.gz
exchange-bc7957f39338f220ec4a7e1b21e17b6142b809de.tar.bz2
exchange-bc7957f39338f220ec4a7e1b21e17b6142b809de.zip
fix fakebank memory leak
-rw-r--r--src/bank-lib/fakebank.c4
-rw-r--r--src/exchange-lib/exchange_api_reserve.c9
2 files changed, 10 insertions, 3 deletions
diff --git a/src/bank-lib/fakebank.c b/src/bank-lib/fakebank.c
index b54cf44c6..ff7ecef90 100644
--- a/src/bank-lib/fakebank.c
+++ b/src/bank-lib/fakebank.c
@@ -832,8 +832,8 @@ handle_history (struct TALER_FAKEBANK_Handle *h,
"wt_subject", subject);
GNUNET_assert (NULL != trans);
GNUNET_free (subject);
- GNUNET_assert (0 == json_array_append (history,
- trans));
+ GNUNET_assert (0 == json_array_append_new (history,
+ trans));
if (count > 0)
{
pos = pos->next;
diff --git a/src/exchange-lib/exchange_api_reserve.c b/src/exchange-lib/exchange_api_reserve.c
index ab857f28f..72429d4e8 100644
--- a/src/exchange-lib/exchange_api_reserve.c
+++ b/src/exchange-lib/exchange_api_reserve.c
@@ -570,12 +570,15 @@ handle_reserve_status_finished (void *cls,
break;
}
if (NULL != rsh->cb)
+ {
rsh->cb (rsh->cb_cls,
response_code,
TALER_JSON_get_error_code (json),
json,
NULL,
0, NULL);
+ rsh->cb = NULL;
+ }
TALER_EXCHANGE_reserve_status_cancel (rsh);
}
@@ -745,7 +748,8 @@ reserve_withdraw_ok (struct TALER_EXCHANGE_ReserveWithdrawHandle *wsh,
struct GNUNET_CRYPTO_RsaSignature *blind_sig;
struct TALER_FreshCoin fc;
struct GNUNET_JSON_Specification spec[] = {
- GNUNET_JSON_spec_rsa_signature ("ev_sig", &blind_sig),
+ GNUNET_JSON_spec_rsa_signature ("ev_sig",
+ &blind_sig),
GNUNET_JSON_spec_end()
};
@@ -961,11 +965,14 @@ handle_reserve_withdraw_finished (void *cls,
break;
}
if (NULL != wsh->cb)
+ {
wsh->cb (wsh->cb_cls,
response_code,
TALER_JSON_get_error_code (json),
NULL,
json);
+ wsh->cb = NULL;
+ }
TALER_EXCHANGE_reserve_withdraw_cancel (wsh);
}