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