[gnome-control-center] background: Fix a memory leak when add_single_file failed



commit 50269ab1d999346f35e7dd1b40f07028b8501a22
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Nov 18 14:15:32 2013 +0100

    background: Fix a memory leak when add_single_file failed
    
    https://bugzilla.gnome.org/show_bug.cgi?id=708942

 panels/background/bg-pictures-source.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/panels/background/bg-pictures-source.c b/panels/background/bg-pictures-source.c
index a611641..038b4f5 100644
--- a/panels/background/bg-pictures-source.c
+++ b/panels/background/bg-pictures-source.c
@@ -279,12 +279,12 @@ add_single_file (BgPicturesSource *bg_source,
   g_file_read_async (file, G_PRIORITY_DEFAULT,
                      bg_source->priv->cancellable,
                      picture_opened_for_read, bg_source);
-  g_object_unref (file);
 
   retval = TRUE;
 
  out:
   g_clear_object (&item);
+  g_object_unref (file);
   g_free (uri);
   return retval;
 }


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