[easytag] Avoid a crash when deleting files



commit 00b2d93082e779121c16bf7d634497027128d919
Author: David King <amigadave amigadave com>
Date:   Mon Aug 24 21:59:21 2015 +0100

    Avoid a crash when deleting files
    
    Fix GList usage in ET_Remove_File_From_File_List(), which was broken in
    commit 6e7d4ab8dd2a0a96f320f9581f2df129c8324d5c, by passing the data
    pointer (not the GList pointer) to g_list_remove(). Additionally, drop
    some bogus g_list_free() calls left over from the old commit.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1252925

 src/file_list.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/src/file_list.c b/src/file_list.c
index db5e184..9aff73d 100644
--- a/src/file_list.c
+++ b/src/file_list.c
@@ -835,21 +835,17 @@ ET_Remove_File_From_File_List (ET_File *ETFile)
     }
 
     /* Remove the file from the ETFileList list. */
-    ETCore->ETFileList = g_list_remove (ETCore->ETFileList, ETFileList);
+    ETCore->ETFileList = g_list_remove (ETCore->ETFileList, ETFile);
 
     // Remove the file from the ETArtistAlbumList list
     ET_Remove_File_From_Artist_Album_List(ETFile);
 
     /* Remove the file from the ETFileDisplayedList list (if not already). */
     ETCore->ETFileDisplayedList = g_list_remove (g_list_first (ETCore->ETFileDisplayedList),
-                                                 ETFileDisplayedList);
+                                                 ETFile);
 
     // Free data of the file
     ET_Free_File_List_Item(ETFile);
-    if (ETFileList)
-        g_list_free(ETFileList);
-    if (ETFileDisplayedList)
-        g_list_free(ETFileDisplayedList);
 
     /* Recalculate length of ETFileDisplayedList list. */
     ETCore->ETFileDisplayedList_Length = et_displayed_file_list_length (ETCore->ETFileDisplayedList);


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