telepathy-qt: dbus-tubes: Fix leaks in dbus tubes service

Dario Freddi drf at kemper.freedesktop.org
Tue Jul 3 15:08:56 PDT 2012


Module: telepathy-qt
Branch: master
Commit: 61788f9d4b6d937d2f15ae781f61f8e84334cabb
URL:    http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=61788f9d4b6d937d2f15ae781f61f8e84334cabb

Author: Dario Freddi <dario.freddi at collabora.com>
Date:   Fri Nov 11 21:36:12 2011 +0100

dbus-tubes: Fix leaks in dbus tubes service

---

 tests/lib/glib/dbus-tube-chan.c |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/tests/lib/glib/dbus-tube-chan.c b/tests/lib/glib/dbus-tube-chan.c
index 12091c0..bd2f8e4 100644
--- a/tests/lib/glib/dbus-tube-chan.c
+++ b/tests/lib/glib/dbus-tube-chan.c
@@ -18,9 +18,6 @@
 #include <dbus/dbus-glib.h>
 #include <dbus/dbus-glib-lowlevel.h>
 
-#include <gio/gunixsocketaddress.h>
-#include <gio/gunixconnection.h>
-
 #include <glib/gstdio.h>
 
 enum
@@ -114,6 +111,8 @@ tp_tests_dbus_tube_channel_set_property (GObject *object,
   switch (property_id)
     {
       case PROP_SUPPORTED_ACCESS_CONTROLS:
+        if (self->priv->supported_access_controls != NULL)
+          g_array_free (self->priv->supported_access_controls, FALSE);
         self->priv->supported_access_controls = g_value_dup_boxed (value);
         break;
 
@@ -203,6 +202,24 @@ dispose (GObject *object)
 
   tp_clear_pointer (&self->priv->dbus_names, g_hash_table_unref);
 
+  if (self->priv->supported_access_controls != NULL)
+    g_array_free (self->priv->supported_access_controls, TRUE);
+
+  if (self->priv->parameters != NULL)
+    g_hash_table_destroy (self->priv->parameters);
+
+  if (self->priv->dbus_srv != NULL)
+    dbus_server_unref (self->priv->dbus_srv);
+
+  if (self->priv->dbus_conn != NULL)
+    dbus_connection_unref (self->priv->dbus_conn);
+
+  if (self->priv->dbus_srv_addr != NULL)
+    g_free (self->priv->dbus_srv_addr);
+
+  if (self->priv->socket_path != NULL)
+    g_free (self->priv->socket_path);
+
   ((GObjectClass *) tp_tests_dbus_tube_channel_parent_class)->dispose (
     object);
 }



More information about the telepathy-commits mailing list