[empathy: 48/80] Don't leak the account and entity



commit 6c7d3bb978f03da13cfc6dbef4d4a5b034283ce1
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date:   Wed Apr 27 11:02:20 2011 +0100

    Don't leak the account and entity

 libempathy-gtk/empathy-log-window.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c
index 0066c9b..5168818 100644
--- a/libempathy-gtk/empathy-log-window.c
+++ b/libempathy-gtk/empathy-log-window.c
@@ -1031,6 +1031,7 @@ model_has_entity (GtkTreeModel *model,
   TplLogSearchHit *hit = data;
   TplEntity *e;
   TpAccount *a;
+  gboolean ret = FALSE;
 
   gtk_tree_model_get (model, iter,
       COL_WHO_TARGET, &e,
@@ -1040,11 +1041,13 @@ model_has_entity (GtkTreeModel *model,
   if (e != NULL && entity_equal (hit->target, e) &&
       a != NULL && account_equal (hit->account, a))
     {
-      has_element = TRUE;
-      return TRUE;
+      ret = has_element = TRUE;
     }
 
-  return FALSE;
+  tp_clear_object (&e);
+  tp_clear_object (&a);
+
+  return ret;
 }
 
 static gboolean



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