[glib] gcontenttype: Fix a potential g_object_unref(NULL) call



commit 44af12aba114c82e04fa78eb2ad9aaf8aa5137b2
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Tue Nov 26 11:07:45 2013 +0000

    gcontenttype: Fix a potential g_object_unref(NULL) call
    
    This can happen if the g_file_query_info() call fails, returning NULL.
    
    Found with scan-build.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=113075

 gio/gcontenttype.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gio/gcontenttype.c b/gio/gcontenttype.c
index 8dc5896..d54f042 100644
--- a/gio/gcontenttype.c
+++ b/gio/gcontenttype.c
@@ -1325,7 +1325,7 @@ matchlet_match (TreeMatchlet *matchlet,
             result = FALSE;
         }
 
-      g_object_unref (info);
+      g_clear_object (&info);
       g_object_unref (file);
     }
   while (!result);


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