[Telepathy-commits] [telepathy-gabble/master] GetAliases: don't leak a hash table if handles are invalid

Simon McVittie simon.mcvittie at collabora.co.uk
Wed Oct 22 04:23:27 PDT 2008


---
 src/conn-aliasing.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/conn-aliasing.c b/src/conn-aliasing.c
index 6cc439a..a8050d9 100644
--- a/src/conn-aliasing.c
+++ b/src/conn-aliasing.c
@@ -967,8 +967,7 @@ gabble_connection_get_aliases (TpSvcConnectionInterfaceAliasing *iface,
   TpBaseConnection *base = (TpBaseConnection *) self;
   TpHandleRepoIface *contact_handles = tp_base_connection_get_handles (base,
       TP_HANDLE_TYPE_CONTACT);
-  GHashTable *result = g_hash_table_new_full (g_direct_hash, g_direct_equal,
-    NULL, g_free);
+  GHashTable *result;
   GError *error = NULL;
   guint i;
 
@@ -983,6 +982,9 @@ gabble_connection_get_aliases (TpSvcConnectionInterfaceAliasing *iface,
       return;
     }
 
+  result = g_hash_table_new_full (g_direct_hash, g_direct_equal,
+    NULL, g_free);
+
   for (i = 0; i < contacts->len; i++)
     {
       TpHandle handle = g_array_index (contacts, TpHandle, i);
-- 
1.5.6.5




More information about the Telepathy-commits mailing list