Fix #846: Geeqie Find duplicates segfaults when drag & dropping images
authorColin Clark <[email protected]>
Sun, 9 Jan 2022 15:39:38 +0000 (15:39 +0000)
committerColin Clark <[email protected]>
Sun, 9 Jan 2022 15:39:38 +0000 (15:39 +0000)
https://github.com/BestImageViewer/geeqie/issues/846

Calls to file_data_ref() needed.

src/dupe.c

index a573d1bffaa39e35700cbd82089ac98677cb0da7..0cedf8b2a3fb0e9a5f46c31ae46fce92d853ac6a 100644 (file)
@@ -3013,6 +3013,7 @@ void dupe_window_add_files(DupeWindow *dw, GList *list, gboolean recurse)
                                        {
                                        /* Add only the files, ignore the dirs when no recurse */
                                        dw->add_files_queue = g_list_prepend(dw->add_files_queue, work_file->data);
+                                       file_data_ref((FileData *)work_file->data);
                                        work_file = work_file->next;
                                        }
                                g_list_free(f);
@@ -3022,6 +3023,7 @@ void dupe_window_add_files(DupeWindow *dw, GList *list, gboolean recurse)
                else
                        {
                        dw->add_files_queue = g_list_prepend(dw->add_files_queue, fd);
+                       file_data_ref(fd);
                        }
                }
        if (dw->add_files_queue_id == 0)