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 82 : TALER_EXCHANGEDB_free_coin_transaction_list (
27 : struct TALER_EXCHANGEDB_TransactionList *tl)
28 : {
29 208 : while (NULL != tl)
30 : {
31 126 : switch (tl->type)
32 : {
33 75 : case TALER_EXCHANGEDB_TT_DEPOSIT:
34 : {
35 : struct TALER_EXCHANGEDB_DepositListEntry *deposit;
36 :
37 75 : deposit = tl->details.deposit;
38 75 : GNUNET_free (deposit->receiver_wire_account.full_payto);
39 75 : GNUNET_free (deposit);
40 75 : break;
41 : }
42 10 : case TALER_EXCHANGEDB_TT_MELT:
43 10 : GNUNET_free (tl->details.melt->denom_pub_hashes);
44 10 : GNUNET_free (tl->details.melt);
45 10 : break;
46 1 : case TALER_EXCHANGEDB_TT_RECOUP_REFRESH_RECEIVER:
47 : {
48 : struct TALER_EXCHANGEDB_RecoupRefreshListEntry *rr;
49 :
50 1 : rr = tl->details.old_coin_recoup;
51 1 : TALER_denom_sig_free (&rr->coin.denom_sig);
52 1 : GNUNET_free (rr);
53 1 : break;
54 : }
55 13 : case TALER_EXCHANGEDB_TT_REFUND:
56 13 : GNUNET_free (tl->details.refund);
57 13 : break;
58 11 : case TALER_EXCHANGEDB_TT_RECOUP_WITHDRAW:
59 11 : GNUNET_free (tl->details.recoup);
60 11 : break;
61 1 : case TALER_EXCHANGEDB_TT_RECOUP_REFRESH:
62 : {
63 : struct TALER_EXCHANGEDB_RecoupRefreshListEntry *rr;
64 :
65 1 : rr = tl->details.recoup_refresh;
66 1 : TALER_denom_sig_free (&rr->coin.denom_sig);
67 1 : GNUNET_free (rr);
68 1 : break;
69 : }
70 9 : case TALER_EXCHANGEDB_TT_PURSE_DEPOSIT:
71 : {
72 : struct TALER_EXCHANGEDB_PurseDepositListEntry *deposit;
73 :
74 9 : deposit = tl->details.purse_deposit;
75 9 : GNUNET_free (deposit->exchange_base_url);
76 9 : GNUNET_free (deposit);
77 9 : break;
78 : }
79 0 : case TALER_EXCHANGEDB_TT_PURSE_REFUND:
80 : {
81 : struct TALER_EXCHANGEDB_PurseRefundListEntry *prefund;
82 :
83 0 : prefund = tl->details.purse_refund;
84 0 : GNUNET_free (prefund);
85 0 : break;
86 : }
87 6 : case TALER_EXCHANGEDB_TT_RESERVE_OPEN:
88 : {
89 : struct TALER_EXCHANGEDB_ReserveOpenListEntry *role;
90 :
91 6 : role = tl->details.reserve_open;
92 6 : GNUNET_free (role);
93 6 : break;
94 : }
95 : }
96 : {
97 : struct TALER_EXCHANGEDB_TransactionList *next;
98 :
99 126 : next = tl->next;
100 126 : GNUNET_free (tl);
101 126 : tl = next;
102 : }
103 : }
104 82 : }
105 :
106 :
107 : /* end of free_coin_transaction_list.c */
|