[tracker/tracker-1.2] tracker-extract: Don't crash if g_file_make_symbolic_link() fails with no GError



commit 9d4c55c61301c23190308482ff37e1ba65d32a09
Author: Martyn Russell <martyn lanedo com>
Date:   Wed Dec 10 09:35:34 2014 +0000

    tracker-extract: Don't crash if g_file_make_symbolic_link() fails with no GError
    
    We assume error is set, but in some cases it is not. Check before using it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=741141
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1133042

 src/tracker-extract/tracker-extract-persistence.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-persistence.c 
b/src/tracker-extract/tracker-extract-persistence.c
index 38bdd35..ee9ebf1 100644
--- a/src/tracker-extract/tracker-extract-persistence.c
+++ b/src/tracker-extract/tracker-extract-persistence.c
@@ -144,8 +144,8 @@ persistence_store_file (TrackerExtractPersistence *persistence,
 
        if (!success) {
                g_warning ("Could not save '%s' into failsafe persistence store: %s",
-                          path, error->message);
-               g_error_free (error);
+                          path, error ? error->message : "no error given");
+               g_clear_error (&error);
        }
 
        g_object_unref (link_file);


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