[gvfs] client: Do not leak GDBusConnection reference



commit 1f64137766fad0d7a24044f9b1f725e374eda5b6
Author: Ondrej Holy <oholy redhat com>
Date:   Tue Jan 24 14:29:57 2017 +0100

    client: Do not leak GDBusConnection reference
    
    async_construct_proxy() calls g_object_ref() on connection, because
    the connection is unrefed by async_call_finish(). The returned connection
    might be NULL in some cases and g_bus_get() is called instead. However,
    g_bus_get_finish() is "transfer full" and thus one reference is leaked.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=747412

 client/gdaemonfile.c  |    1 +
 client/gdaemonmount.c |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c
index abc81cf..ac24014 100644
--- a/client/gdaemonfile.c
+++ b/client/gdaemonfile.c
@@ -626,6 +626,7 @@ bus_get_cb (GObject *source_object,
     }
 
   async_construct_proxy (connection, data);
+  g_object_unref (connection);
 }
 
 static void
diff --git a/client/gdaemonmount.c b/client/gdaemonmount.c
index 9bba2d1..d49fad8 100644
--- a/client/gdaemonmount.c
+++ b/client/gdaemonmount.c
@@ -303,6 +303,7 @@ bus_get_cb (GObject *source_object,
     }
 
   async_construct_proxy (connection, task);
+  g_object_unref (connection);
 }
 
 static void


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