[file-roller/wip/jtojnar/clang-analysis: 4/8] fixup! archive-libarchive: Use automatic cleanup macros




commit bf64e2e8e0b4ff1c76fdaa7e8adc106b97ba1e4c
Author: Jan Tojnar <jtojnar gmail com>
Date:   Sat Sep 3 21:04:20 2022 +0200

    fixup! archive-libarchive: Use automatic cleanup macros

 src/fr-archive-libarchive.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/src/fr-archive-libarchive.c b/src/fr-archive-libarchive.c
index 5f189014..2fa0b2d6 100644
--- a/src/fr-archive-libarchive.c
+++ b/src/fr-archive-libarchive.c
@@ -1807,7 +1807,7 @@ _add_files_begin (SaveData *save_data,
        fr_archive_progress_set_total_files (load_data->archive, add_data->n_files_to_add);
 
        if (load_data->archive->files_to_add_size == 0) {
-               GList *files_to_add;
+               g_autoptr (GList) files_to_add = NULL;
                GList *scan;
 
                files_to_add = g_hash_table_get_values (add_data->files_to_add);
@@ -1819,8 +1819,6 @@ _add_files_begin (SaveData *save_data,
 
                        load_data->archive->files_to_add_size += _g_file_get_size (add_file->file, 
load_data->cancellable);
                }
-
-               g_list_free (files_to_add);
        }
 
        FrArchiveLibarchivePrivate *private = fr_archive_libarchive_get_instance_private 
(FR_ARCHIVE_LIBARCHIVE (load_data->archive));
@@ -1864,7 +1862,7 @@ _add_files_end (SaveData *save_data,
 {
        AddData  *add_data = user_data;
        LoadData *load_data = LOAD_DATA (save_data);
-       GList    *remaining_files;
+       g_autoptr (GList) remaining_files = NULL;
        GList    *scan;
 
        /* allow to add files to a new archive */
@@ -1893,8 +1891,6 @@ _add_files_end (SaveData *save_data,
 
                fr_archive_progress_inc_completed_files (load_data->archive, 1);
        }
-
-       g_list_free (remaining_files);
 }
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]