[easytag] Avoid crash when declining deleting a file



commit 17afda799f95c97263e52ab41fa8c9676aba3021
Author: David King <amigadave amigadave com>
Date:   Fri Mar 7 15:34:08 2014 +0000

    Avoid crash when declining deleting a file
    
    https://retrace.fedoraproject.org/faf/problems/1586226/

 src/easytag.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/easytag.c b/src/easytag.c
index 40dbeec..52a1619 100644
--- a/src/easytag.c
+++ b/src/easytag.c
@@ -2637,9 +2637,14 @@ Delete_Selected_Files_With_Answer (void)
                 ET_Remove_File_From_File_List(ETFile);
                 break;
             case 0:
-                Log_Print (LOG_ERROR, _("Cannot delete file (%s)"),
-                           error->message);
-                g_error_free (error);
+                /* Distinguish between the file being skipped, and there being
+                 * an error during deletion. */
+                if (error)
+                {
+                    Log_Print (LOG_ERROR, _("Cannot delete file (%s)"),
+                               error->message);
+                    g_clear_error (&error);
+                }
                 break;
             case -1:
                 // Stop deleting files + reinit progress bar


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