aboutsummaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_reserves_history.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-06-04 13:26:00 +0200
committerChristian Grothoff <christian@grothoff.org>2023-06-04 13:26:00 +0200
commit809300158caaa0215c36ef89c7e38f0edfa93593 (patch)
tree1faf7e314af34db7a2333d8003ee0ed6fca91d74 /src/lib/exchange_api_reserves_history.c
parent9718bc4920ab4781378b777bf3e2af275c8d0575 (diff)
code cleanup, fixing misc. memory leaks in the process
Diffstat (limited to 'src/lib/exchange_api_reserves_history.c')
-rw-r--r--src/lib/exchange_api_reserves_history.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/exchange_api_reserves_history.c b/src/lib/exchange_api_reserves_history.c
index 2a0dd565..ccc11a27 100644
--- a/src/lib/exchange_api_reserves_history.c
+++ b/src/lib/exchange_api_reserves_history.c
@@ -99,7 +99,7 @@ static enum GNUNET_GenericReturnValue
handle_reserves_history_ok (struct TALER_EXCHANGE_ReservesHistoryHandle *rsh,
const json_t *j)
{
- json_t *history;
+ const json_t *history;
unsigned int len;
struct TALER_EXCHANGE_ReserveHistory rs = {
.hr.reply = j,
@@ -110,8 +110,8 @@ handle_reserves_history_ok (struct TALER_EXCHANGE_ReservesHistoryHandle *rsh,
struct GNUNET_JSON_Specification spec[] = {
TALER_JSON_spec_amount_any ("balance",
&rs.details.ok.balance),
- GNUNET_JSON_spec_json ("history",
- &history),
+ GNUNET_JSON_spec_array_const ("history",
+ &history),
GNUNET_JSON_spec_end ()
};
@@ -143,7 +143,6 @@ handle_reserves_history_ok (struct TALER_EXCHANGE_ReservesHistoryHandle *rsh,
GNUNET_break_op (0);
TALER_EXCHANGE_free_reserve_history (rhistory,
len);
- GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
if (NULL != rsh->cb)
@@ -157,7 +156,6 @@ handle_reserves_history_ok (struct TALER_EXCHANGE_ReservesHistoryHandle *rsh,
TALER_EXCHANGE_free_reserve_history (rhistory,
len);
}
- GNUNET_JSON_parse_free (spec);
return GNUNET_OK;
}