]> git.0d.be Git - empathy.git/commitdiff
filter_func: don't leak individual
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 17 May 2011 08:06:50 +0000 (10:06 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 18 May 2011 13:40:10 +0000 (15:40 +0200)
src/empathy-invite-participant-dialog.c

index bdae6bf82ad37ddb35525ec3743ce61bd2e1714c..379b23121029c2bf67fc904301f436cf25831020 100644 (file)
@@ -167,7 +167,7 @@ filter_func (GtkTreeModel *model,
   TpContact *contact;
   gboolean is_online;
   GList *members, *l;
-  gboolean display;
+  gboolean display = FALSE;
   TpChannel *channel;
 
   gtk_tree_model_get (model, iter,
@@ -176,13 +176,14 @@ filter_func (GtkTreeModel *model,
       -1);
 
   if (individual == NULL || !is_online)
-    return FALSE;
+    goto out;
 
   /* Filter out individuals not having a persona on the same connection as the
    * EmpathyTpChat. */
   contact = get_tp_contact_for_chat (self, individual);
+
   if (contact == NULL)
-    return FALSE;
+    goto out;
 
   /* Filter out contacts which are already in the chat */
   members = empathy_contact_list_get_members (EMPATHY_CONTACT_LIST (
@@ -212,6 +213,8 @@ filter_func (GtkTreeModel *model,
   g_list_foreach (members, (GFunc) g_object_unref, NULL);
   g_list_free (members);
 
+out:
+  tp_clear_object (&individual);
   return display;
 }