From 809300158caaa0215c36ef89c7e38f0edfa93593 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 4 Jun 2023 13:26:00 +0200 Subject: code cleanup, fixing misc. memory leaks in the process --- src/lib/exchange_api_reserves_status.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/lib/exchange_api_reserves_status.c') diff --git a/src/lib/exchange_api_reserves_status.c b/src/lib/exchange_api_reserves_status.c index 27f63d24..57fb0427 100644 --- a/src/lib/exchange_api_reserves_status.c +++ b/src/lib/exchange_api_reserves_status.c @@ -89,7 +89,7 @@ static enum GNUNET_GenericReturnValue handle_reserves_status_ok (struct TALER_EXCHANGE_ReservesStatusHandle *rsh, const json_t *j) { - json_t *history; + const json_t *history; unsigned int len; struct TALER_EXCHANGE_ReserveStatus rs = { .hr.reply = j, @@ -98,8 +98,8 @@ handle_reserves_status_ok (struct TALER_EXCHANGE_ReservesStatusHandle *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 () }; @@ -145,7 +145,6 @@ handle_reserves_status_ok (struct TALER_EXCHANGE_ReservesStatusHandle *rsh, TALER_EXCHANGE_free_reserve_history (rhistory, len); } - GNUNET_JSON_parse_free (spec); return GNUNET_OK; } -- cgit v1.2.3