Line data Source code
1 : /*
2 : This file is part of TALER
3 : Copyright (C) 2015, 2016, 2020, 2024 Taler Systems SA
4 :
5 : TALER is free software; you can redistribute it and/or modify it under the
6 : terms of the GNU General Public License as published by the Free Software
7 : Foundation; either version 3, or (at your option) any later version.
8 :
9 : TALER is distributed in the hope that it will be useful, but WITHOUT ANY
10 : WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 : A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12 :
13 : You should have received a copy of the GNU General Public License along with
14 : TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
15 : */
16 : /**
17 : * @file exchangedb/free_coin_transaction_list.c
18 : * @brief Implementation to free the coin transaction list
19 : * @author Christian Grothoff
20 : */
21 : #include "platform.h"
22 : #include "exchange-database/free_coin_transaction_list.h"
23 :
24 :
25 : void
26 86 : TALER_EXCHANGEDB_free_coin_transaction_list (
27 : struct TALER_EXCHANGEDB_TransactionList *tl)
28 : {
29 218 : while (NULL != tl)
30 : {
31 132 : switch (tl->type)
32 : {
33 77 : case TALER_EXCHANGEDB_TT_DEPOSIT:
34 : {
35 : struct TALER_EXCHANGEDB_DepositListEntry *deposit;
36 :
37 77 : deposit = tl->details.deposit;
38 77 : GNUNET_free (deposit->receiver_wire_account.full_payto);
39 77 : GNUNET_free (deposit);
40 77 : break;
41 : }
42 14 : case TALER_EXCHANGEDB_TT_MELT:
43 : {
44 14 : struct TALER_EXCHANGEDB_MeltListEntry *melt = tl->details.melt;
45 :
46 14 : GNUNET_free (melt->transfer_pubs);
47 14 : GNUNET_free (melt->denom_pub_hashes);
48 14 : GNUNET_free (melt);
49 14 : break;
50 : }
51 1 : case TALER_EXCHANGEDB_TT_RECOUP_REFRESH_RECEIVER:
52 : {
53 : struct TALER_EXCHANGEDB_RecoupRefreshListEntry *rr;
54 :
55 1 : rr = tl->details.old_coin_recoup;
56 1 : TALER_denom_sig_free (&rr->coin.denom_sig);
57 1 : GNUNET_free (rr);
58 1 : break;
59 : }
60 13 : case TALER_EXCHANGEDB_TT_REFUND:
61 13 : GNUNET_free (tl->details.refund);
62 13 : break;
63 11 : case TALER_EXCHANGEDB_TT_RECOUP_WITHDRAW:
64 11 : GNUNET_free (tl->details.recoup);
65 11 : break;
66 1 : case TALER_EXCHANGEDB_TT_RECOUP_REFRESH:
67 : {
68 : struct TALER_EXCHANGEDB_RecoupRefreshListEntry *rr;
69 :
70 1 : rr = tl->details.recoup_refresh;
71 1 : TALER_denom_sig_free (&rr->coin.denom_sig);
72 1 : GNUNET_free (rr);
73 1 : break;
74 : }
75 9 : case TALER_EXCHANGEDB_TT_PURSE_DEPOSIT:
76 : {
77 : struct TALER_EXCHANGEDB_PurseDepositListEntry *deposit;
78 :
79 9 : deposit = tl->details.purse_deposit;
80 9 : GNUNET_free (deposit->exchange_base_url);
81 9 : GNUNET_free (deposit);
82 9 : break;
83 : }
84 0 : case TALER_EXCHANGEDB_TT_PURSE_REFUND:
85 : {
86 : struct TALER_EXCHANGEDB_PurseRefundListEntry *prefund;
87 :
88 0 : prefund = tl->details.purse_refund;
89 0 : GNUNET_free (prefund);
90 0 : break;
91 : }
92 6 : case TALER_EXCHANGEDB_TT_RESERVE_OPEN:
93 : {
94 : struct TALER_EXCHANGEDB_ReserveOpenListEntry *role;
95 :
96 6 : role = tl->details.reserve_open;
97 6 : GNUNET_free (role);
98 6 : break;
99 : }
100 : }
101 : {
102 : struct TALER_EXCHANGEDB_TransactionList *next;
103 :
104 132 : next = tl->next;
105 132 : GNUNET_free (tl);
106 132 : tl = next;
107 : }
108 : }
109 86 : }
110 :
111 :
112 : /* end of free_coin_transaction_list.c */
|