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