aboutsummaryrefslogtreecommitdiff
path: root/src/json/json_helper.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-10-29 21:26:02 +0100
committerChristian Grothoff <christian@grothoff.org>2023-10-29 21:26:02 +0100
commitc6c149714c9b39844d6dee2b5339907cca5bed3c (patch)
tree2b9f63ddf6b810a0565e4da4bffad15772aad49a /src/json/json_helper.c
parent3784541b6c7e178546e91d9cb6579d8643989f59 (diff)
-fix misc memory leaks
Diffstat (limited to 'src/json/json_helper.c')
-rw-r--r--src/json/json_helper.c21
1 files changed, 20 insertions, 1 deletions
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
};