[Telepathy-commits] [telepathy-gabble/master] d_bus_names_changed_removed: don't leak arrays if handle_type == TP_HANDLE_TYPE_CONTACT
Guillaume Desmottes
guillaume.desmottes at collabora.co.uk
Wed Dec 17 08:56:46 PST 2008
---
src/tubes-channel.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/tubes-channel.c b/src/tubes-channel.c
index ff7e2e2..738c0a7 100644
--- a/src/tubes-channel.c
+++ b/src/tubes-channel.c
@@ -358,12 +358,15 @@ d_bus_names_changed_removed (GabbleTubesChannel *self,
TpHandle contact)
{
GabbleTubesChannelPrivate *priv = GABBLE_TUBES_CHANNEL_GET_PRIVATE (self);
- GPtrArray *added = g_ptr_array_new ();
- GArray *removed = g_array_new (FALSE, FALSE, sizeof (guint));
+ GPtrArray *added;
+ GArray *removed;
if (priv->handle_type == TP_HANDLE_TYPE_CONTACT)
return;
+ added = g_ptr_array_new ();
+ removed = g_array_new (FALSE, FALSE, sizeof (guint));
+
g_array_append_val (removed, contact);
tp_svc_channel_type_tubes_emit_d_bus_names_changed (self,
--
1.5.6.5
More information about the Telepathy-commits
mailing list