LCOV - code coverage report
Current view: top level - exchangedb - free_coin_transaction_list.c (source / functions) Coverage Total Hit
Test: coverage.info Lines: 68.9 % 45 31
Test Date: 2026-09-11 18:55:36 Functions: 100.0 % 1 1

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

Generated by: LCOV version 2.0-1