From c6c149714c9b39844d6dee2b5339907cca5bed3c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 29 Oct 2023 21:26:02 +0100 Subject: -fix misc memory leaks --- src/json/json_helper.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/json') diff --git a/src/json/json_helper.c b/src/json/json_helper.c index 2cc63e170..71291a9e5 100644 --- a/src/json/json_helper.c +++ b/src/json/json_helper.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2014-2021 Taler Systems SA + Copyright (C) 2014-2023 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -1238,6 +1238,24 @@ parse_exchange_withdraw_values (void *cls, } +/** + * Cleanup data left from parsing withdraw values + * + * @param cls closure, NULL + * @param[out] spec where to free the data + */ +static void +clean_exchange_withdraw_values ( + void *cls, + struct GNUNET_JSON_Specification *spec) +{ + struct TALER_ExchangeWithdrawValues *ewv = spec->ptr; + + (void) cls; + TALER_denom_ewv_free (ewv); +} + + struct GNUNET_JSON_Specification TALER_JSON_spec_exchange_withdraw_values ( const char *field, @@ -1245,6 +1263,7 @@ TALER_JSON_spec_exchange_withdraw_values ( { struct GNUNET_JSON_Specification ret = { .parser = &parse_exchange_withdraw_values, + .cleaner = &clean_exchange_withdraw_values, .field = field, .ptr = ewv }; -- cgit v1.2.3